<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>Background Fetch</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://www.w3.org/StyleSheets/TR/2016/cg-draft" rel="stylesheet">
  <link href="https://wicg.github.io/background-fetch/" rel="canonical">
<style>
  .algorithm dl {
    overflow: hidden;
  }
  .algorithm dt {
    font-weight: normal;
    float: left;
    clear: left;
    line-height: 1.5;
    margin-right: 0.3em;
  }
  .algorithm dt::after {
    content: '- ';
  }
  .algorithm dd {
    margin-left: 0em;
  }
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-railroad */
svg.railroad-diagram{background-color:hsl(30,20%,95%);}svg.railroad-diagram path{stroke-width:3px;stroke:black;fill:rgba(0,0,0,0);}svg.railroad-diagram text{font:bold 14px monospace;text-anchor:middle;}svg.railroad-diagram text.label{text-anchor:start;}svg.railroad-diagram text.comment{font:italic 12px monospace;}svg.railroad-diagram rect{stroke-width:3px;stroke:black;fill:hsl(120,100%,90%);}</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"></p>
   <h1 class="p-name no-ref" id="title">Background Fetch</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Draft Community Group Report, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://wicg.github.io/background-fetch/">https://wicg.github.io/background-fetch/</a>
     <dt class="editor">Editors:
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:jakearchibald@google.com">Jake Archibald</a> (<span class="p-org org">Google</span>)
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:beverloo@google.com">Peter Beverloo</a> (<span class="p-org org">Google</span>)
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 the Contributors to the Background Fetch Specification, published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a> under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a>.
A human-readable <a href="http://www.w3.org/community/about/agreements/cla-deed/">summary</a> is available. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>An API to handle large uploads/downloads in the background with user visibility.</p>
  </div>
  <div data-fill-with="at-risk"></div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This specification was published by the <a href="https://www.w3.org/community/wicg/">Web Platform Incubator Community Group</a>.
  It is not a W3C Standard nor is it on the W3C Standards Track.

  Please note that under the <a href="https://www.w3.org/community/about/agreements/cla/">W3C Community Contributor License Agreement (CLA)</a> there is a limited opt-out and other conditions apply.

  Learn more about <a href="http://www.w3.org/community/">W3C Community and Business Groups</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
    <li><a href="#realms"><span class="secno">2</span> <span class="content">Realms</span></a>
    <li>
     <a href="#infrastructure"><span class="secno">3</span> <span class="content">Infrastructure</span></a>
     <ol class="toc">
      <li><a href="#service-worker-registration-concept-extensions"><span class="secno">3.1</span> <span class="content">Extensions to service worker registration</span></a>
      <li>
       <a href="#background-fetch-concept"><span class="secno">3.2</span> <span class="content"><span>Background fetch</span></span></a>
       <ol class="toc">
        <li><a href="#background-fetch-display-algorithm"><span class="secno">3.2.1</span> <span class="content"><span>Display</span></span></a>
       </ol>
      <li><a href="#background-fetch-record-concept"><span class="secno">3.3</span> <span class="content">Background fetch record</span></a>
      <li><a href="#background-fetch-response-concept"><span class="secno">3.4</span> <span class="content">Background fetch response</span></a>
     </ol>
    <li>
     <a href="#algorithms"><span class="secno">4</span> <span class="content">Algorithms</span></a>
     <ol class="toc">
      <li><a href="#perform-a-background-fetch-algorithm"><span class="secno">4.1</span> <span class="content"><span>Perform a background fetch</span></span></a>
      <li><a href="#complete-a-record-algorithm"><span class="secno">4.2</span> <span class="content"><span>Complete a record</span></span></a>
      <li><a href="#update-background-fetch-instance-algorithm"><span class="secno">4.3</span> <span class="content"><span>Update background fetch instances</span></span></a>
      <li><a href="#fire-a-background-fetch-click-event-algorithm"><span class="secno">4.4</span> <span class="content"><span>Fire a background fetch click event</span></span></a>
      <li><a href="#get-a-backgroundfetchregistration-instance-algorithm"><span class="secno">4.5</span> <span class="content"><span>Get a BackgroundFetchRegistration instance</span></span></a>
      <li><a href="#validate-partial-response-algorithm"><span class="secno">4.6</span> <span class="content"><span>Validate a partial response</span></span></a>
      <li><a href="#extract-content-range-values-algorithm"><span class="secno">4.7</span> <span class="content"><span>Extract content-range values</span></span></a>
      <li><a href="#create-settled-fetches-algorithm"><span class="secno">4.8</span> <span class="content"><span>Create record objects</span></span></a>
      <li><a href="#contains-background-fetch-algorithm"><span class="secno">4.9</span> <span class="content"><span>Contains background fetch</span></span></a>
     </ol>
    <li><a href="#header-syntax"><span class="secno">5</span> <span class="content">Header syntax</span></a>
    <li>
     <a href="#api"><span class="secno">6</span> <span class="content">API</span></a>
     <ol class="toc">
      <li>
       <a href="#extensions-to-service-worker-global"><span class="secno">6.1</span> <span class="content">Extensions to <code class="idl"><span>ServiceWorkerGlobalScope</span></code></span></a>
       <ol class="toc">
        <li><a href="#service-worker-global-events"><span class="secno">6.1.1</span> <span class="content">Events</span></a>
       </ol>
      <li><a href="#extensions-to-service-worker-registration"><span class="secno">6.2</span> <span class="content">Extensions to <code class="idl"><span>ServiceWorkerRegistration</span></code></span></a>
      <li>
       <a href="#background-fetch-manager"><span class="secno">6.3</span> <span class="content"><code class="idl"><span>BackgroundFetchManager</span></code></span></a>
       <ol class="toc">
        <li><a href="#background-fetch-manager-fetch"><span class="secno">6.3.1</span> <span class="content"><code class="idl"><span>fetch()</span></code></span></a>
        <li><a href="#background-fetch-manager-get"><span class="secno">6.3.2</span> <span class="content"><code class="idl"><span>get()</span></code></span></a>
        <li><a href="#background-fetch-manager-get-ids"><span class="secno">6.3.3</span> <span class="content"><code class="idl"><span>getIds()</span></code></span></a>
       </ol>
      <li>
       <a href="#background-fetch-registration"><span class="secno">6.4</span> <span class="content"><code class="idl"><span>BackgroundFetchRegistration</span></code></span></a>
       <ol class="toc">
        <li><a href="#background-fetch-registration-events"><span class="secno">6.4.1</span> <span class="content">Events</span></a>
        <li><a href="#background-fetch-registration-abort"><span class="secno">6.4.2</span> <span class="content"><code class="idl"><span>abort()</span></code></span></a>
        <li><a href="#background-fetch-registration-match"><span class="secno">6.4.3</span> <span class="content"><code class="idl"><span>match()</span></code></span></a>
        <li><a href="#background-fetch-registration-match-all"><span class="secno">6.4.4</span> <span class="content"><code class="idl"><span>matchAll()</span></code></span></a>
       </ol>
      <li><a href="#background-fetch-record-interface"><span class="secno">6.5</span> <span class="content"><code class="idl"><span>BackgroundFetchRecord</span></code></span></a>
      <li><a href="#background-fetch-event"><span class="secno">6.6</span> <span class="content"><code class="idl"><span>BackgroundFetchEvent</span></code></span></a>
      <li>
       <a href="#background-fetch-update-ui-event"><span class="secno">6.7</span> <span class="content"><code class="idl"><span>BackgroundFetchUpdateUIEvent</span></code></span></a>
       <ol class="toc">
        <li><a href="#background-fetch-update-ui-event-update-ui"><span class="secno">6.7.1</span> <span class="content"><code class="idl"><span>updateUI()</span></code></span></a>
       </ol>
     </ol>
    <li>
     <a href="#automation"><span class="secno">7</span> <span class="content">Automation</span></a>
     <ol class="toc">
      <li><a href="#automation-click"><span class="secno">7.1</span> <span class="content"><span>Click</span></span></a>
     </ol>
    <li><a href="#privacy-and-bandwidth-use"><span class="secno">8</span> <span class="content">Privacy and bandwidth usage</span></a>
    <li><a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>A <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker">service worker</a> is capable of fetching and caching assets, the size of which is restricted only by <a href="https://storage.spec.whatwg.org/#usage-and-quota">origin storage</a>. However, if the user navigates away from the site or closes the browser, the service worker is <a href="https://www.w3.org/TR/service-workers-1/#service-worker-lifetime">likely to be killed</a>. This can happen even if there’s a pending promise passed to <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil" id="ref-for-dom-extendableevent-waituntil">waitUntil()</a></code> - if it hasn’t resolved within a few minutes the browser may consider it an abuse of <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker" id="ref-for-dfn-service-worker①">service worker</a> and kill the process.</p>
   <p>This is excellent for battery and privacy, but it makes it difficult to download and cache large assets such as podcasts and movies, and upload video and images.</p>
   <p>This specification aims to:</p>
   <ul>
    <li data-md>
     <p>Allow fetches (requests &amp; responses) to continue even if the user closes all windows &amp; workers to the origin.</p>
    <li data-md>
     <p>Allow a single job to involve many requests, as defined by the app.</p>
    <li data-md>
     <p>Allow the browser/OS to show UI to indicate the progress of that job, and allow the user to pause/abort.</p>
    <li data-md>
     <p>Allow the browser/OS to deal with poor connectivity by pausing/resuming the download.</p>
    <li data-md>
     <p>Allow the app to react to success/failure of the job, perhaps by caching the results.</p>
    <li data-md>
     <p>Allow access to background-fetched resources as they fetch.</p>
   </ul>
   <h2 class="heading settled" data-level="2" id="realms"><span class="secno">2. </span><span class="content">Realms</span><a class="self-link" href="#realms"></a></h2>
   <p>All platform objects are created in the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm">relevant Realm</a> unless otherwise specified.</p>
   <h2 class="heading settled" data-level="3" id="infrastructure"><span class="secno">3. </span><span class="content">Infrastructure</span><a class="self-link" href="#infrastructure"></a></h2>
   <p>A resource is considered <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="temporarily-unavailable">temporarily unavailable</dfn> if the user agent believes the resource may soon become available. Reasons may include:</p>
   <ul>
    <li data-md>
     <p>The user agent is offline.</p>
    <li data-md>
     <p>The user agent is behind a captive portal.</p>
   </ul>
   <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="background-fetch-task-source">background fetch task source</dfn> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source">task source</a>.</p>
   <div class="algorithm" data-algorithm="queue a bgfetch task"> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="queue-a-bgfetch-task">queue a bgfetch task</dfn> on an optional <var>eventLoop</var> (an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop">event loop</a>, defaulting to the caller’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop">responsible event loop</a>) with <var>steps</var> (steps), <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">queue a task</a> on <var>eventLoop</var> using the <a data-link-type="dfn" href="#background-fetch-task-source" id="ref-for-background-fetch-task-source">background fetch task source</a> to run <var>steps</var>. </div>
   <h3 class="heading settled" data-level="3.1" id="service-worker-registration-concept-extensions"><span class="secno">3.1. </span><span class="content">Extensions to service worker registration</span><a class="self-link" href="#service-worker-registration-concept-extensions"></a></h3>
   <p>A <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration">service worker registration</a> additionally has:</p>
   <div>
    <ul>
     <li data-md>
      <p><dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="service-worker-registration-active-background-fetches">Active background fetches</dfn> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map">map</a>), where each key is a DOMString, and each item is a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch">background fetch</a>. It is initially an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map①">map</a>.</p>
     <li data-md>
      <p>An <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="service-worker-registration-active-background-fetches-edit-queue">active background fetches edit queue</dfn> (a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#parallel-queue" id="ref-for-parallel-queue">parallel queue</a>), initially the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#starting-a-new-parallel-queue" id="ref-for-starting-a-new-parallel-queue">starting a new parallel queue</a>.</p>
    </ul>
   </div>
   <h3 class="heading settled" data-level="3.2" id="background-fetch-concept"><span class="secno">3.2. </span><span class="content"><a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①">Background fetch</a></span><a class="self-link" href="#background-fetch-concept"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="background-fetch">background fetch</dfn> consists of:</p>
   <div>
    <ul>
     <li data-md>
      <p>An <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-id">id</dfn> (a DOMString).</p>
     <li data-md>
      <p><dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-records">Records</dfn> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a> of <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record">background fetch records</a>).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-title">title</dfn> (a DOMString).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-download-total">download total</dfn> (a number).</p>
     <li data-md>
      <p>An <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-upload-total">upload total</dfn> (a number).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-uploaded">uploaded</dfn> (a number), initially 0.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-result">result</dfn> (a <code class="idl"><a data-link-type="idl" href="#enumdef-backgroundfetchresult" id="ref-for-enumdef-backgroundfetchresult">BackgroundFetchResult</a></code>), initially the empty string.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-failure-reason">failure reason</dfn> (a <code class="idl"><a data-link-type="idl" href="#enumdef-backgroundfetchfailurereason" id="ref-for-enumdef-backgroundfetchfailurereason">BackgroundFetchFailureReason</a></code>), initially the empty string.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-records-available-flag">records available flag</dfn> initially set.</p>
     <li data-md>
      <p><dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-icons">Icons</dfn> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a> of <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/appmanifest/#dom-imageresource" id="ref-for-dom-imageresource">ImageResource</a></code>s).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-service-worker-registration">service worker registration</dfn> (a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①">service worker registration</a>).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-update-handling-queue">update handling queue</dfn> (a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#parallel-queue" id="ref-for-parallel-queue①">parallel queue</a>), initially the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#starting-a-new-parallel-queue" id="ref-for-starting-a-new-parallel-queue①">starting a new parallel queue</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-paused-flag">paused flag</dfn>, initially unset.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-abort-all-flag">abort all flag</dfn>, initially unset.</p>
    </ul>
    <div class="algorithm" data-algorithm="stored body bytes total">
      To get a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch②">background fetch</a>'s (<var>bgFetch</var>) <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-stored-body-bytes-total">stored body bytes total</dfn>, run these steps: 
     <ol>
      <li data-md>
       <p>Let <var>total</var> be 0.</p>
      <li data-md>
       <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate">For each</a> <var>record</var> of <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records">records</a>:</p>
       <ol>
        <li data-md>
         <p>Increment <var>total</var> by the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length">length</a> of <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-response-data" id="ref-for-background-fetch-record-response-data">response data</a>'s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes">bytes</a>.</p>
       </ol>
      <li data-md>
       <p>Return <var>total</var>.</p>
     </ol>
    </div>
    <h4 class="heading settled" data-level="3.2.1" id="background-fetch-display-algorithm"><span class="secno">3.2.1. </span><span class="content"><a data-link-type="dfn" href="#background-fetch-display" id="ref-for-background-fetch-display">Display</a></span><a class="self-link" href="#background-fetch-display-algorithm"></a></h4>
    <div class="algorithm" data-algorithm="display">
      To <dfn class="dfn-paneled" data-dfn-for="background fetch" data-dfn-type="dfn" data-noexport id="background-fetch-display">display</dfn> a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch③">background fetch</a> (<var>bgFetch</var>) for a given <var>environment</var> (an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object">environment settings object</a>), the user agent must present a user interface that follows these rules: 
     <ul>
      <li data-md>
       <p>The UI must prominently display the <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration">service worker registration</a>'s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-scope-url" id="ref-for-dfn-scope-url">scope url</a>'s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin">origin</a></p>
      <li data-md>
       <p>If the <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag">paused flag</a> is unset, and <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result">result</a> is not the empty string, then the UI must indicate that bandwidth is being used.</p>
      <li data-md>
       <p>The UI cannot be dismissed without aborting (e.g. swiped away) until <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result①">result</a> is not the empty string.</p>
      <li data-md>
       <p>The UI may display <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-title" id="ref-for-background-fetch-title">title</a>.</p>
      <li data-md>
       <p>The UI may select an icon for display from <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-icons" id="ref-for-background-fetch-icons">icons</a>, and <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch">fetch</a> it using a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request">request</a> with the following properties:</p>
       <dl>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url">URL</a>
        <dd data-md>
         <p>The <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/appmanifest/#dom-imageresource" id="ref-for-dom-imageresource①">ImageResource</a></code>'s <code class="idl"><a data-link-type="idl">src</a></code>.</p>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client">Client</a>
        <dd data-md>
         <p><var>environment</var>.</p>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#request-keepalive-flag" id="ref-for-request-keepalive-flag">Keepalive flag</a>
        <dd data-md>
         <p>Set.</p>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#request-service-workers-mode" id="ref-for-request-service-workers-mode">Service-workers mode</a>
        <dd data-md>
         <p>"<code>none</code>".</p>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-destination" id="ref-for-concept-request-destination">Destination</a>
        <dd data-md>
         <p>"<code>image</code>".</p>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode" id="ref-for-concept-request-mode">Mode</a>
        <dd data-md>
         <p>"<code>no-cors</code>".</p>
        <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-credentials-mode" id="ref-for-concept-request-credentials-mode">Credentials mode</a>
        <dd data-md>
         <p>"<code>include</code>".</p>
       </dl>
       <p class="issue" id="issue-20b63876"><a class="self-link" href="#issue-20b63876"></a> <a href="https://github.com/w3c/manifest/pull/710">manifest/pull/710</a>.</p>
      <li data-md>
       <p>The UI may use <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-download-total" id="ref-for-background-fetch-download-total">download total</a>, <a data-link-type="dfn" href="#background-fetch-upload-total" id="ref-for-background-fetch-upload-total">upload total</a>, <a data-link-type="dfn" href="#background-fetch-stored-body-bytes-total" id="ref-for-background-fetch-stored-body-bytes-total">stored body bytes total</a>, <a data-link-type="dfn" href="#background-fetch-uploaded" id="ref-for-background-fetch-uploaded">uploaded</a>, <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag①">paused flag</a>, and <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result②">result</a> to present the progress of the fetch.</p>
      <li data-md>
       <p>The UI must provide a way for the user to abort the <var>bgFetch</var> by setting <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-abort-all-flag" id="ref-for-background-fetch-abort-all-flag">abort all flag</a>.</p>
      <li data-md>
       <p>If every <a data-link-type="dfn" href="#background-fetch-record-request" id="ref-for-background-fetch-record-request">request</a> in <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records①">records</a> has the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method">method</a> `<code>GET</code>`, the UI may provide a way to toggle <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag②">paused flag</a>.</p>
       <p class="note" role="note"><span>Note:</span> If a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method①">method</a> is not `<code>GET</code>`, reissuing the request may have unwanted side effects.</p>
      <li data-md>
       <p>The UI may be activated (for example, by clicking), in which case <a data-link-type="dfn" href="#fire-a-background-fetch-click-event" id="ref-for-fire-a-background-fetch-click-event">fire a background fetch click event</a> for <var>bgFetch</var>.</p>
      <li data-md>
       <p>The UI may remain once the operation is complete, in which case it can still be activated.</p>
     </ul>
     <p>Let <var>permission</var> be the <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-state" id="ref-for-permission-state">permission state</a> for a <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor">PermissionDescriptor</a></code> with <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name">name</a></code> <code>"background-fetch"</code> and <var>environment</var>. If <var>permission</var> is <code>"prompt"</code>, then the user agent may set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag③">paused flag</a> at the beginning of this algorithm. The user agent should allow the user to either accept the background fetch (unsetting <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag④">paused flag</a>), or refuse the background fetch (setting <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-abort-all-flag" id="ref-for-background-fetch-abort-all-flag①">abort all flag</a>). The user agent may also provide always-allow and alway-deny options, which can be used as <a data-link-type="dfn" href="https://w3c.github.io/permissions/#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent">new information about the user’s intent</a> for this permission.</p>
     <p>The user agent may also consider setting <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag⑤">paused flag</a> if the user is on a metered connection, or the background fetch was started in the background.</p>
    </div>
   </div>
   <h3 class="heading settled" data-level="3.3" id="background-fetch-record-concept"><span class="secno">3.3. </span><span class="content">Background fetch record</span><a class="self-link" href="#background-fetch-record-concept"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="background-fetch-record">background fetch record</dfn> consists of:</p>
   <div>
    <ul>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch record" data-dfn-type="dfn" data-noexport id="background-fetch-record-request">request</dfn> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request①">request</a>).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch record" data-dfn-type="dfn" data-noexport id="background-fetch-record-response-data">response data</dfn> (a <a data-link-type="dfn" href="#background-fetch-response" id="ref-for-background-fetch-response">background fetch response</a>), initially a new <a data-link-type="dfn" href="#background-fetch-response" id="ref-for-background-fetch-response①">background fetch response</a>.</p>
    </ul>
   </div>
   <h3 class="heading settled" data-level="3.4" id="background-fetch-response-concept"><span class="secno">3.4. </span><span class="content">Background fetch response</span><a class="self-link" href="#background-fetch-response-concept"></a></h3>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="background-fetch-response">Background fetch response</dfn> consists of:</p>
   <div>
    <ul>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch response" data-dfn-type="dfn" data-noexport id="background-fetch-response-response">response</dfn> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response">response</a> or null), initially null.</p>
     <li data-md>
      <p><dfn class="dfn-paneled" data-dfn-for="background fetch response" data-dfn-type="dfn" data-noexport id="background-fetch-response-bytes">Bytes</dfn> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence">byte sequence</a>), initially an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①">byte sequence</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="background fetch response" data-dfn-type="dfn" data-noexport id="background-fetch-response-result">result</dfn>, (any <code class="idl"><a data-link-type="idl" href="#enumdef-backgroundfetchfailurereason" id="ref-for-enumdef-backgroundfetchfailurereason①">BackgroundFetchFailureReason</a></code>, <code>"success"</code>, or <code>"redundant"</code>), initially the empty string.</p>
    </ul>
    <p>The <a data-link-type="dfn" href="#background-fetch-response-response" id="ref-for-background-fetch-response-response">response</a> can be <dfn class="dfn-paneled" data-dfn-for="background fetch response" data-dfn-type="dfn" data-noexport id="background-fetch-response-exposed">exposed</dfn> if the <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result">result</a> is the empty string, <code>"success"</code>, or <code>"bad-status"</code>.</p>
   </div>
   <h2 class="heading settled" data-level="4" id="algorithms"><span class="secno">4. </span><span class="content">Algorithms</span><a class="self-link" href="#algorithms"></a></h2>
   <h3 class="heading settled" data-level="4.1" id="perform-a-background-fetch-algorithm"><span class="secno">4.1. </span><span class="content"><a data-link-type="dfn" href="#perform-a-background-fetch" id="ref-for-perform-a-background-fetch">Perform a background fetch</a></span><a class="self-link" href="#perform-a-background-fetch-algorithm"></a></h3>
   <p class="note" role="note"><span>Note:</span> This is the algorithm that manages the 'background' parts of a background fetch. Only one instance of this algorithm runs per <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch④">background fetch</a>.</p>
   <div class="algorithm" data-algorithm="perform a background fetch">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="perform-a-background-fetch">perform a background fetch</dfn> for <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch⑤">background fetch</a>), run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>swRegistration</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration①">service worker registration</a>.</p>
     <li data-md>
      <p>Let <var>settledFetches</var> be 0.</p>
     <li data-md>
      <p>Let <var>immediateFailure</var> be false.</p>
     <li data-md>
      <p>Let <var>failureReason</var> be the empty string.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate①">For each</a> <var>record</var> in <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records②">records</a>, run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">in parallel</a>:</p>
      <ol>
       <li data-md>
        <p><a data-link-type="dfn" href="#complete-a-record" id="ref-for-complete-a-record">Complete a record</a> for <var>bgFetch</var> and <var>record</var>.</p>
       <li data-md>
        <p>Let <var>result</var> be <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-response-data" id="ref-for-background-fetch-record-response-data①">response data</a>'s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①">result</a>.</p>
       <li data-md>
        <p>If <var>failureReason</var> is not the empty string:</p>
        <ol>
         <li data-md>
          <p class="assertion">Assert: <var>result</var> is not <code>"redundant"</code>.</p>
         <li data-md>
          <p>Set <var>failureReason</var> to <var>result</var>.</p>
        </ol>
       <li data-md>
        <p>Increment <var>settledFetches</var> by 1.</p>
       <li data-md>
        <p>If <var>result</var> is <code>"download-total-exceeded"</code>, then set <var>immediateFailure</var> to true.</p>
      </ol>
     <li data-md>
      <p>Wait for <var>settledFetches</var> to be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records③">records</a>'s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size">size</a>, or <var>immediateFailure</var> to be true.</p>
     <li data-md>
      <p>If <var>immediateFailure</var> is true, set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-abort-all-flag" id="ref-for-background-fetch-abort-all-flag②">abort all flag</a>.</p>
      <p class="note" role="note"><span>Note:</span> The <a data-link-type="dfn" href="#complete-a-record" id="ref-for-complete-a-record①">complete a record</a> algorithm listens to this flag and terminates the fetch when set.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps">Enqueue the following steps</a> to <var>swRegistration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches-edit-queue" id="ref-for-service-worker-registration-active-background-fetches-edit-queue">active background fetches edit queue</a>:</p>
      <ol>
       <li data-md>
        <p>Let <var>activeBgFetches</var> be <var>swRegistration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches" id="ref-for-service-worker-registration-active-background-fetches">active background fetches</a>.</p>
       <li data-md>
        <p>Let <var>id</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-id" id="ref-for-background-fetch-id">id</a>.</p>
       <li data-md>
        <p>If <var>activeBgFetches</var> <a data-link-type="dfn" href="#contains-background-fetch" id="ref-for-contains-background-fetch">contains background fetch</a> <var>bgFetch</var>, then remove <var>activeBgFetches</var>[<var>id</var>].</p>
       <li data-md>
        <p>Otherwise, set <var>failureReason</var> to <code>"aborted"</code>.</p>
        <p class="note" role="note"><span>Note:</span> This handles a race condition where <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-abort" id="ref-for-dom-backgroundfetchregistration-abort">abort()</a></code> was successfully called but one of the fetches failed at the same time. If we’ve returned true from <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-abort" id="ref-for-dom-backgroundfetchregistration-abort①">abort()</a></code>, this ensures we fire the related abort event.</p>
       <li data-md>
        <p>If <var>failureReason</var> is not the empty string, then:</p>
        <ol>
         <li data-md>
          <p>Set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result③">result</a> to <code>"failure"</code>.</p>
         <li data-md>
          <p>Set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-failure-reason" id="ref-for-background-fetch-failure-reason">failure reason</a> to <var>failureReason</var>.</p>
        </ol>
       <li data-md>
        <p>Otherwise, set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result④">result</a> to <code>"success"</code>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="#update-background-fetch-instances" id="ref-for-update-background-fetch-instances">Update background fetch instances</a> for <var>bgFetch</var>.</p>
       <li data-md>
        <p>Let <var>eventName</var> be the empty string.</p>
       <li data-md>
        <p>Let <var>eventConstructor</var> be null.</p>
       <li data-md>
        <p>If <var>failureReason</var> is <code>"aborted"</code>, then:</p>
        <ol>
         <li data-md>
          <p>Set <var>eventName</var> to "<code>backgroundfetchabort</code>".</p>
         <li data-md>
          <p>Set <var>eventConstructor</var> to <code class="idl"><a data-link-type="idl" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent">BackgroundFetchEvent</a></code>.</p>
        </ol>
       <li data-md>
        <p>Otherwise, if <var>failureReason</var> is not the empty string, then:</p>
        <ol>
         <li data-md>
          <p>Set <var>eventName</var> to "<code>backgroundfetchfail</code>".</p>
         <li data-md>
          <p>Set <var>eventConstructor</var> to <code class="idl"><a data-link-type="idl" href="#backgroundfetchupdateuievent" id="ref-for-backgroundfetchupdateuievent">BackgroundFetchUpdateUIEvent</a></code>.</p>
        </ol>
       <li data-md>
        <p>Otherwise:</p>
        <ol>
         <li data-md>
          <p>Set <var>eventName</var> to "<code>backgroundfetchsuccess</code>".</p>
         <li data-md>
          <p>Set <var>eventConstructor</var> to <code class="idl"><a data-link-type="idl" href="#backgroundfetchupdateuievent" id="ref-for-backgroundfetchupdateuievent①">BackgroundFetchUpdateUIEvent</a></code>.</p>
        </ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#fire-functional-event" id="ref-for-fire-functional-event">Fire a functional event</a> named <var>eventName</var> using <var>eventConstructor</var> on <var>swRegistration</var> with the following properties:</p>
        <dl>
         <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchevent-registration" id="ref-for-dom-backgroundfetchevent-registration">registration</a></code>
         <dd data-md>
          <p>The result of <a data-link-type="dfn" href="#get-a-backgroundfetchregistration-instance" id="ref-for-get-a-backgroundfetchregistration-instance">getting a BackgroundFetchRegistration instance</a> for <var>bgFetch</var> in the event object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm①">relevant Realm</a>.</p>
        </dl>
        <p>Then run these steps with <var>dispatchedEvent</var> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>:</p>
        <ol>
         <li data-md>
          <p>Wait until <var>dispatchedEvent</var> is not <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#extendableevent-active" id="ref-for-extendableevent-active">active</a>.</p>
          <p class="issue" id="issue-b420dc4f"><a class="self-link" href="#issue-b420dc4f"></a> <a href="https://github.com/w3c/ServiceWorker/pull/1348">ServiceWorker/1348</a>.</p>
         <li data-md>
          <p>Unset <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records-available-flag" id="ref-for-background-fetch-records-available-flag">records available flag</a>.</p>
         <li data-md>
          <p><a data-link-type="dfn" href="#update-background-fetch-instances" id="ref-for-update-background-fetch-instances①">Update background fetch instances</a> for <var>bgFetch</var>.</p>
        </ol>
      </ol>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.2" id="complete-a-record-algorithm"><span class="secno">4.2. </span><span class="content"><a data-link-type="dfn" href="#complete-a-record" id="ref-for-complete-a-record②">Complete a record</a></span><a class="self-link" href="#complete-a-record-algorithm"></a></h3>
   <p class="note" role="note"><span>Note:</span> This algorithm manages the fetching of a <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record①">background fetch record</a>. One instance of this algorithm is started per <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record②">background fetch record</a>, but it is called recursively to retry fetches or to fetch the next part of a partial response.</p>
   <div class="algorithm" data-algorithm="complete a record">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="complete-a-record">complete a record</dfn> for <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch⑥">background fetch</a>) and <var>record</var> (a <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record③">background fetch record</a>), run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>responseData</var> be <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-response-data" id="ref-for-background-fetch-record-response-data②">response data</a>.</p>
     <li data-md>
      <p>Let <var>downloadTotal</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-download-total" id="ref-for-background-fetch-download-total①">download total</a> if it is not 0, otherwise infinity.</p>
     <li data-md>
      <p>Wait for <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag⑥">paused flag</a> to be unset.</p>
     <li data-md>
      <p>Let <var>request</var> be a copy of <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-request" id="ref-for-background-fetch-record-request①">request</a>.</p>
      <p class="note" role="note"><span>Note:</span> At this point the request is entirely held in storage, even if it started as a stream.</p>
     <li data-md>
      <p>Set <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#request-keepalive-flag" id="ref-for-request-keepalive-flag①">keepalive flag</a>.</p>
     <li data-md>
      <p>Set <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#request-service-workers-mode" id="ref-for-request-service-workers-mode①">service-workers mode</a> to "<code>none</code>".</p>
     <li data-md>
      <p>Let <var>rangeStart</var> be the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length①">length</a> of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes①">bytes</a>.</p>
     <li data-md>
      <p>If <var>rangeStart</var> is not 0, then <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-add-range-header" id="ref-for-concept-request-add-range-header">add a range header</a> to <var>request</var> with <var>rangeStart</var>.</p>
      <p class="note" role="note"><span>Note:</span> If the <var>rangeStart</var> is 0, a normal request is made. This allows the initial request to make use of content encoding, since <code>Accept-Encoding: identity</code> is added to requests with a range header.</p>
     <li data-md>
      <p>Let <var>fetchAttemptComplete</var> be false.</p>
     <li data-md>
      <p>Let <var>lastTransmittedSize</var> be 0.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch①">Fetch</a> <var>request</var>.</p>
      <p class="issue" id="issue-775cdb79"><a class="self-link" href="#issue-775cdb79"></a> The remainder of this step uses fetch "callbacks" which currently queue tasks. This isn’t desirable or possible here, so let’s pretend that tasks aren’t queued. (<a href="https://github.com/whatwg/fetch/issues/536#issuecomment-330184276">issue</a>)</p>
      <p>To <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#process-request-body" id="ref-for-process-request-body">process request body</a> for <var>request</var>, run these steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>transmittedSize</var> be <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-transmitted" id="ref-for-concept-body-transmitted">transmitted bytes</a>.</p>
       <li data-md>
        <p>Increment <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-uploaded" id="ref-for-background-fetch-uploaded①">uploaded</a> by <var>transmittedSize</var> minus <var>lastTransmittedSize</var>.</p>
       <li data-md>
        <p>Set <var>lastTransmittedSize</var> to <var>transmittedSize</var>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="#update-background-fetch-instances" id="ref-for-update-background-fetch-instances②">Update background fetch instances</a> for <var>bgFetch</var>.</p>
      </ol>
      <p>To <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#process-response" id="ref-for-process-response">process response</a> for <var>response</var>, run these steps:</p>
      <ol>
       <li data-md>
        <p>If <var>response</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error">network error</a>, then:</p>
        <ol>
         <li data-md>
          <p>If the resource is <a data-link-type="dfn" href="#temporarily-unavailable" id="ref-for-temporarily-unavailable">temporarily unavailable</a> and <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method②">method</a> is `<code>GET</code>`, then wait until the resource is not <a data-link-type="dfn" href="#temporarily-unavailable" id="ref-for-temporarily-unavailable①">temporarily unavailable</a>, then set <var>fetchAttemptComplete</var> to true and abort these steps.</p>
          <p class="note" role="note"><span>Note:</span> If <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method③">method</a> is not `<code>GET</code>`, reissuing the request may have unwanted side effects. If a standard method to resume requests becomes available, it’ll be adopted here.</p>
         <li data-md>
          <p>If <var>response</var> is an <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-aborted-network-error" id="ref-for-concept-aborted-network-error">aborted network error</a>, then set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result②">result</a> to <code>"aborted"</code>, otherwise <code>"fetch-error"</code>.</p>
         <li data-md>
          <p>Set <var>fetchAttemptComplete</var> to true, and abort these steps.</p>
        </ol>
       <li data-md>
        <p>If <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status">status</a> is <code>206</code>, then:</p>
        <ol>
         <li data-md>
          <p>If <a data-link-type="dfn" href="#validate-a-partial-response" id="ref-for-validate-a-partial-response">validate a partial response</a> for <var>rangeStart</var>, <var>response</var>, and <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-response" id="ref-for-background-fetch-response-response①">response</a> returns invalid, then:</p>
          <ol>
           <li data-md>
            <p>Set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result③">result</a> to <code>"fetch-error"</code>.</p>
           <li data-md>
            <p>Set <var>fetchAttemptComplete</var> to true.</p>
           <li data-md>
            <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch-terminate" id="ref-for-concept-fetch-terminate">Terminate</a> the ongoing fetch, and abort these steps.</p>
          </ol>
        </ol>
       <li data-md>
        <p>Otherwise:</p>
        <ol>
         <li data-md>
          <p>Set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result④">result</a> to <code>"redundant"</code>.</p>
         <li data-md>
          <p>Set <var>responseData</var> to a new <a data-link-type="dfn" href="#background-fetch-response" id="ref-for-background-fetch-response②">background fetch response</a>.</p>
         <li data-md>
          <p>Set <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-response-data" id="ref-for-background-fetch-record-response-data③">response data</a> to <var>responseData</var>.</p>
          <p class="note" role="note"><span>Note:</span> The <a data-link-type="dfn" href="#create-record-objects" id="ref-for-create-record-objects">create record objects</a> algorithm may hold a reference to the previous <a data-link-type="dfn" href="#background-fetch-response" id="ref-for-background-fetch-response③">background fetch response</a>.</p>
         <li data-md>
          <p><a data-link-type="dfn" href="#update-background-fetch-instances" id="ref-for-update-background-fetch-instances③">Update background fetch instances</a> for <var>bgFetch</var>.</p>
        </ol>
       <li data-md>
        <p>If <var>rangeStart</var> is 0 or <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status①">status</a> is not <code>206</code>, then set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-response" id="ref-for-background-fetch-response-response②">response</a> to a copy of <var>response</var> except for its <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body">body</a>.</p>
       <li data-md>
        <p>Let <var>stream</var> be the <var>response</var> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body①">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream">stream</a>.</p>
       <li data-md>
        <p>Whenever one or more bytes are transmitted from <var>stream</var>, let <var>bytes</var> be the transmitted bytes and run these steps:</p>
        <ol>
         <li data-md>
          <p>If <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-stored-body-bytes-total" id="ref-for-background-fetch-stored-body-bytes-total①">stored body bytes total</a> plus the size of <var>bytes</var> is greater than <var>downloadTotal</var>, then:</p>
          <ol>
           <li data-md>
            <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream" id="ref-for-concept-cancel-readablestream">Cancel</a> <var>stream</var>.</p>
           <li data-md>
            <p>Set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result⑤">result</a> to <code>"download-total-exceeded"</code>, <var>fetchAttemptComplete</var> to true, and abort these steps.</p>
          </ol>
         <li data-md>
          <p>Append <var>bytes</var> to <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes②">bytes</a>.</p>
         <li data-md>
          <p>If the previous step fails due to exceeding a quota limit, set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result⑥">result</a> to <code>"quota-exceeded"</code>, <var>fetchAttemptComplete</var> to true, and abort these steps.</p>
         <li data-md>
          <p><a data-link-type="dfn" href="#update-background-fetch-instances" id="ref-for-update-background-fetch-instances④">Update background fetch instances</a> for <var>bgFetch</var>.</p>
        </ol>
       <li data-md>
        <p>If at any point the bytes transmission for <var>stream</var> is done normally, then:</p>
        <ol>
         <li data-md>
          <p>If <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status②">status</a> is <code>206</code>, then:</p>
          <ol>
           <li data-md>
            <p>Let <var>firstBytePos</var>, <var>lastBytePos</var>, and <var>completeLength</var> be the result of <a data-link-type="dfn" href="#extract-content-range-values" id="ref-for-extract-content-range-values">extracting content-range values</a> from <var>response</var>.</p>
           <li data-md>
            <p>If <var>completeLength</var> is not null, and equal to the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length②">length</a> of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes③">bytes</a>, set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result⑦">result</a> to <code>"success"</code>.</p>
            <p class="note" role="note"><span>Note:</span> Although we ask for the whole resource, or the remainder of the resource, the server may not have returned the remainder, in which case we need to make an additional request.</p>
          </ol>
         <li data-md>
          <p>Otherwise, if <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status③">status</a> is not an <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#ok-status" id="ref-for-ok-status">ok status</a>, set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result⑧">result</a> to <code>"bad-status"</code>.</p>
         <li data-md>
          <p>Otherwise, set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result⑨">result</a> to <code>"success"</code>.</p>
         <li data-md>
          <p>Set <var>fetchAttemptComplete</var> to true.</p>
        </ol>
       <li data-md>
        <p>If at any point <var>stream</var> becomes <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored">errored</a>, then:</p>
        <ol>
         <li data-md>
          <p>If the resource is <a data-link-type="dfn" href="#temporarily-unavailable" id="ref-for-temporarily-unavailable②">temporarily unavailable</a> and <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method④">method</a> is `<code>GET</code>`, then   wait until the resource is not <a data-link-type="dfn" href="#temporarily-unavailable" id="ref-for-temporarily-unavailable③">temporarily unavailable</a>, then set <var>fetchAttemptComplete</var> to true.</p>
         <li data-md>
          <p>Otherwise, set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①⓪">result</a> to <code>"fetch-error"</code> and <var>fetchAttemptComplete</var> to true.</p>
        </ol>
      </ol>
     <li data-md>
      <p>Let <var>result</var> be the empty string.</p>
     <li data-md>
      <p>Run these steps, but <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#abort-when" id="ref-for-abort-when">abort when</a> <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag⑦">paused flag</a> or <a data-link-type="dfn" href="#background-fetch-abort-all-flag" id="ref-for-background-fetch-abort-all-flag③">abort all flag</a> is set:</p>
      <ol>
       <li data-md>
        <p>Wait for <var>fetchAttemptComplete</var> to be true.</p>
       <li data-md>
        <p>Set <var>result</var> to <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①①">result</a>.</p>
      </ol>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#if-aborted" id="ref-for-if-aborted">If aborted</a>, then:</p>
      <ol>
       <li data-md>
        <p>If <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-paused-flag" id="ref-for-background-fetch-paused-flag⑧">paused flag</a> is set, then assert <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method⑤">method</a> is `<code>GET</code>`.</p>
       <li data-md>
        <p>If <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-abort-all-flag" id="ref-for-background-fetch-abort-all-flag④">abort all flag</a> is set, then set <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①②">result</a> to <code>"aborted"</code>.</p>
       <li data-md>
        <p>Set <var>result</var> to <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①③">result</a>.</p>
        <p class="note" role="note"><span>Note:</span> The result is stored now, as terminating the fetch may change the result.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch-terminate" id="ref-for-concept-fetch-terminate①">Terminate</a> the ongoing fetch.</p>
      </ol>
     <li data-md>
      <p>If <var>result</var> is the empty string, then <a data-link-type="dfn" href="#complete-a-record" id="ref-for-complete-a-record③">complete a record</a> for <var>bgFetch</var> and <var>record</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.3" id="update-background-fetch-instance-algorithm"><span class="secno">4.3. </span><span class="content"><a data-link-type="dfn" href="#update-background-fetch-instances" id="ref-for-update-background-fetch-instances⑤">Update background fetch instances</a></span><a class="self-link" href="#update-background-fetch-instance-algorithm"></a></h3>
   <div class="algorithm" data-algorithm="update background fetch instances">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="update-background-fetch-instances">update background fetch instances</dfn> for <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch⑦">background fetch</a>), <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps①">enqueue the following steps</a> to <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-update-handling-queue" id="ref-for-background-fetch-update-handling-queue">update handling queue</a>: 
    <ol>
     <li data-md>
      <p>Let <var>downloaded</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-stored-body-bytes-total" id="ref-for-background-fetch-stored-body-bytes-total②">stored body bytes total</a>.</p>
     <li data-md>
      <p>Let <var>uploaded</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-uploaded" id="ref-for-background-fetch-uploaded②">uploaded</a>.</p>
     <li data-md>
      <p>Let <var>result</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result⑤">result</a>.</p>
     <li data-md>
      <p>Let <var>failureReason</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-failure-reason" id="ref-for-background-fetch-failure-reason①">failure reason</a>.</p>
     <li data-md>
      <p>Let <var>recordsAvailable</var> be true if <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-records-available-flag" id="ref-for-background-fetch-records-available-flag①">records available flag</a> is set, otherwise false.</p>
     <li data-md>
      <p>For each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①">environment settings object</a> <var>env</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin">origin</a> is equal to <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration②">service worker registration</a>'s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-scope-url" id="ref-for-dfn-scope-url①">scope URL</a>'s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin①">origin</a>, <a data-link-type="dfn" href="#queue-a-bgfetch-task" id="ref-for-queue-a-bgfetch-task">queue a bgfetch task</a> on <var>env</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①">responsible event loop</a> to run these steps:</p>
      <ol>
       <li data-md>
        <p>Let <var>bgFetchRegistration</var> be the instance of <code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration">BackgroundFetchRegistration</a></code> within the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm②">relevant realm</a> whose <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch">background fetch</a> is equal to <var>bgFetch</var>, or null if none exists.</p>
        <p class="note" role="note"><span>Note:</span> There will be at most one per environment, due to the <a data-link-type="dfn" href="#get-a-backgroundfetchregistration-instance" id="ref-for-get-a-backgroundfetchregistration-instance①">get a BackgroundFetchRegistration instance</a> algorithm.</p>
       <li data-md>
        <p>If <var>bgFetchRegistration</var> is null, then abort these steps.</p>
       <li data-md>
        <p>If <var>recordsAvailable</var> is false and <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-records-available-flag" id="ref-for-backgroundfetchregistration-records-available-flag">records available flag</a> is set, then unset <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-records-available-flag" id="ref-for-backgroundfetchregistration-records-available-flag①">records available flag</a>.</p>
       <li data-md>
        <p>If <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-result" id="ref-for-backgroundfetchregistration-result">result</a> is not the empty string, then abort these steps.</p>
        <p class="note" role="note"><span>Note:</span> This prevents progress being reported after the background fetch has settled. This is possible when the operation has aborted, but some fetches haven’t yet terminated.</p>
       <li data-md>
        <p>If all of the following are true:</p>
        <ul>
         <li data-md>
          <p><var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-downloaded" id="ref-for-backgroundfetchregistration-downloaded">downloaded</a> is equal to <var>downloaded</var>.</p>
         <li data-md>
          <p><var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-uploaded" id="ref-for-backgroundfetchregistration-uploaded">uploaded</a> is equal to <var>uploaded</var>.</p>
         <li data-md>
          <p><var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-result" id="ref-for-backgroundfetchregistration-result①">result</a> is equal to <var>result</var>.</p>
         <li data-md>
          <p><var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-failure-reason" id="ref-for-backgroundfetchregistration-failure-reason">failure reason</a> is equal to <var>failureReason</var>.</p>
        </ul>
        <p>Then abort these steps.</p>
       <li data-md>
        <p>Set <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-downloaded" id="ref-for-backgroundfetchregistration-downloaded①">downloaded</a> to <var>downloaded</var>.</p>
       <li data-md>
        <p>Set <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-uploaded" id="ref-for-backgroundfetchregistration-uploaded①">uploaded</a> to <var>uploaded</var>.</p>
       <li data-md>
        <p>Set <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-result" id="ref-for-backgroundfetchregistration-result②">result</a> to <var>result</var>.</p>
       <li data-md>
        <p>Set <var>bgFetchRegistration</var>’s <a data-link-type="dfn" href="#backgroundfetchregistration-failure-reason" id="ref-for-backgroundfetchregistration-failure-reason①">failure reason</a> to <var>failureReason</var>.</p>
       <li data-md>
        <p><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire">Fire an event</a> named "<code>progress</code>" at <var>bgFetchRegistration</var>.</p>
      </ol>
      <p class="issue" id="issue-20ad71fa"><a class="self-link" href="#issue-20ad71fa"></a> I need to debounce this similar to how mouse move events debounce.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.4" id="fire-a-background-fetch-click-event-algorithm"><span class="secno">4.4. </span><span class="content"><a data-link-type="dfn" href="#fire-a-background-fetch-click-event" id="ref-for-fire-a-background-fetch-click-event①">Fire a background fetch click event</a></span><a class="self-link" href="#fire-a-background-fetch-click-event-algorithm"></a></h3>
   <div class="algorithm" data-algorithm="fire a background fetch click event">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="fire-a-background-fetch-click-event">fire a background fetch click event</dfn> for a <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch⑧">background fetch</a>), <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#fire-functional-event" id="ref-for-fire-functional-event①">fire a functional event</a> named "<code>backgroundfetchclick</code>" using <code class="idl"><a data-link-type="idl" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent①">BackgroundFetchEvent</a></code> on <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration③">service worker registration</a> with the following properties: 
    <dl>
     <dt data-md><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchevent-registration" id="ref-for-dom-backgroundfetchevent-registration①">registration</a></code>
     <dd data-md>
      <p>The result of <a data-link-type="dfn" href="#get-a-backgroundfetchregistration-instance" id="ref-for-get-a-backgroundfetchregistration-instance②">getting a BackgroundFetchRegistration instance</a> for <var>bgFetch</var> in the event object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm③">relevant Realm</a>.</p>
    </dl>
   </div>
   <h3 class="heading settled" data-level="4.5" id="get-a-backgroundfetchregistration-instance-algorithm"><span class="secno">4.5. </span><span class="content"><a data-link-type="dfn" href="#get-a-backgroundfetchregistration-instance" id="ref-for-get-a-backgroundfetchregistration-instance③">Get a BackgroundFetchRegistration instance</a></span><a class="self-link" href="#get-a-backgroundfetchregistration-instance-algorithm"></a></h3>
   <p class="note" role="note"><span>Note:</span> This algorithm ensures the same <code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration①">BackgroundFetchRegistration</a></code> instance is returned for a given <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch⑨">background fetch</a> throughout the life of a <code class="idl"><a data-link-type="idl" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager">BackgroundFetchManager</a></code>. It’s okay for browsers to optimise this, as long as there’s no way to tell that more than one instance has been created for a given <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①⓪">background fetch</a> (e.g. through equality, expandos, or weakly-associated data).</p>
   <div class="algorithm" data-algorithm="get a BackgroundFetchRegistration instance">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="get a BackgroundFetchRegistration instance|getting a BackgroundFetchRegistration instance" data-noexport id="get-a-backgroundfetchregistration-instance">get a BackgroundFetchRegistration instance</dfn> for a <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①①">background fetch</a>) in <var>realm</var> (a <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#realm" id="ref-for-realm">Realm</a>), run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>instancesMap</var> be the <a data-link-type="dfn" href="#backgroundfetchmanager-backgroundfetchregistration-instances" id="ref-for-backgroundfetchmanager-backgroundfetchregistration-instances">BackgroundFetchRegistration instances</a> of the only instance of <code class="idl"><a data-link-type="idl" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager①">BackgroundFetchManager</a></code> within this <var>realm</var>.</p>
     <li data-md>
      <p>If <var>instancesMap</var>[<var>bgFetch</var>] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists">exists</a>, then return <var>instancesMap</var>[<var>bgFetch</var>].</p>
     <li data-md>
      <p>Let <var>instance</var> be a new <code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration②">BackgroundFetchRegistration</a></code> in <var>realm</var>, with its <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch①">background fetch</a> set to <var>bgFetch</var>.</p>
     <li data-md>
      <p>Set <var>instancesMap</var>[<var>bgFetch</var>] to <var>instance</var>.</p>
     <li data-md>
      <p>Return <var>instance</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.6" id="validate-partial-response-algorithm"><span class="secno">4.6. </span><span class="content"><a data-link-type="dfn" href="#validate-a-partial-response" id="ref-for-validate-a-partial-response①">Validate a partial response</a></span><a class="self-link" href="#validate-partial-response-algorithm"></a></h3>
   <p class="note" role="note"><span>Note:</span> This algorithm checks if a partial response reasonably matches what was requested, and optionally checks if it should be combined with a previous response.</p>
   <div class="algorithm" data-algorithm="validate a partial response">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="validate-a-partial-response">validate a partial response</dfn> for an <var>expectedRangeStart</var> (a number), a <var>partialResponse</var> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response①">response</a>), and an optional <var>previousResponse</var> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response②">response</a> or null, null unless otherwise specified), run these steps: 
    <ol>
     <li data-md>
      <p class="assertion">Assert: <var>partialResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status④">status</a> is <code>206</code>.</p>
     <li data-md>
      <p>Let <var>responseFirstBytePos</var>, <var>responseLastBytePos</var>, and <var>responseCompleteLength</var> be the result of <a data-link-type="dfn" href="#extract-content-range-values" id="ref-for-extract-content-range-values①">extracting content-range values</a> from <var>partialResponse</var>. If this fails, then return invalid.</p>
     <li data-md>
      <p>If <var>responseFirstBytePos</var> does not equal <var>expectedRangeStart</var>, then return invalid.</p>
     <li data-md>
      <p>If <var>previousResponse</var> is not null, then:</p>
      <ol>
       <li data-md>
        <p>For <var>headerName</var> of « `<code>ETag</code>`, `<code>Last-Modified</code>` »:</p>
        <ol>
         <li data-md>
          <p>If <var>previousResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list">header list</a> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#header-list-contains" id="ref-for-header-list-contains">contains</a> <var>headerName</var> and the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-combine" id="ref-for-concept-header-list-combine">combined</a> value of <var>headerName</var> in <var>previousResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list①">header list</a> does not equal the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-combine" id="ref-for-concept-header-list-combine①">combined</a> value of <var>headerName</var> in <var>partialResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list②">header list</a>, then return invalid.</p>
        </ol>
       <li data-md>
        <p>If <var>previousResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status⑤">status</a> is <code>206</code>, then:</p>
        <ol>
         <li data-md>
          <p>Let <var>previousResponseFirstBytePos</var>, <var>previousResponseLastBytePos</var>, and <var>previousResponseCompleteLength</var> be the result of <a data-link-type="dfn" href="#extract-content-range-values" id="ref-for-extract-content-range-values②">extracting content-range values</a> from <var>previousResponse</var>. If this fails, then return invalid.</p>
         <li data-md>
          <p>If <var>previousResponseCompleteLength</var> is not null, and <var>responseCompleteLength</var> does not equal <var>previousResponseCompleteLength</var>, then return invalid.</p>
        </ol>
      </ol>
     <li data-md>
      <p>Return valid.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.7" id="extract-content-range-values-algorithm"><span class="secno">4.7. </span><span class="content"><a data-link-type="dfn" href="#extract-content-range-values" id="ref-for-extract-content-range-values③">Extract content-range values</a></span><a class="self-link" href="#extract-content-range-values-algorithm"></a></h3>
   <p class="note" role="note"><span>Note:</span> This algorithm parses `<code>Content-Range</code>` as a <a data-link-type="dfn" href="#single-byte-content-range" id="ref-for-single-byte-content-range">single byte content-range</a> and extracts the values.</p>
   <div class="algorithm" data-algorithm="extract content-range values">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="extract content-range values|extracting content-range values" data-noexport id="extract-content-range-values">extract content-range values</dfn> from a <var>response</var> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response③">response</a>), run these steps: 
    <ol>
     <li data-md>
      <p>If <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list③">header list</a> does not <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#header-list-contains" id="ref-for-header-list-contains①">contain</a> `<code>Content-Range</code>`, then return failure.</p>
     <li data-md>
      <p>Let <var>contentRangeValue</var> be the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-value" id="ref-for-concept-header-value">value</a> of the first <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header" id="ref-for-concept-header">header</a> whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-name" id="ref-for-concept-header-name">name</a> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-case-insensitive" id="ref-for-byte-case-insensitive">byte-case-insensitive</a> match for `<code>Content-Range</code>` in <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list④">header list</a>.</p>
     <li data-md>
      <p>If parsing <var>contentRangeValue</var> per <a data-link-type="dfn" href="#single-byte-content-range" id="ref-for-single-byte-content-range①">single byte content-range</a> fails, then return failure.</p>
     <li data-md>
      <p>Let <var>firstBytePos</var> be the portion of <var>contentRangeValue</var> named <code>first-byte-pos</code> when parsed as <a data-link-type="dfn" href="#single-byte-content-range" id="ref-for-single-byte-content-range②">single byte content-range</a>, parsed as an integer.</p>
     <li data-md>
      <p>Let <var>lastBytePos</var> be the portion of <var>contentRangeValue</var> named <code>last-byte-pos</code> when parsed as <a data-link-type="dfn" href="#single-byte-content-range" id="ref-for-single-byte-content-range③">single byte content-range</a>, parsed as an integer.</p>
     <li data-md>
      <p>Let <var>completeLength</var> be the portion of <var>contentRangeValue</var> named <code>complete-length</code> when parsed as <a data-link-type="dfn" href="#single-byte-content-range" id="ref-for-single-byte-content-range④">single byte content-range</a>.</p>
     <li data-md>
      <p>If <var>completeLength</var> is <code>"*"</code>, then set <var>completeLength</var> to null, otherwise set <var>completeLength</var> to <var>completeLength</var> parsed as an integer.</p>
     <li data-md>
      <p>Return <var>firstBytePos</var>, <var>lastBytePos</var>, and <var>completeLength</var>.</p>
    </ol>
    <p class="issue" id="issue-cddfe468"><a class="self-link" href="#issue-cddfe468"></a> Parsing as an integer <a href="https://github.com/whatwg/infra/issues/189">infra/189</a>.</p>
   </div>
   <h3 class="heading settled" data-level="4.8" id="create-settled-fetches-algorithm"><span class="secno">4.8. </span><span class="content"><a data-link-type="dfn" href="#create-record-objects" id="ref-for-create-record-objects①">Create record objects</a></span><a class="self-link" href="#create-settled-fetches-algorithm"></a></h3>
   <p class="note" role="note"><span>Note:</span> This algorithm creates platform objects for <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record④">background fetch records</a>. It also manages the streaming of the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response④">response</a> from the stored <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes④">bytes</a>. The background fetch operation may still be in progress at this point.</p>
   <div class="algorithm" data-algorithm="create record objects">
     To <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="create record objects|creating record objects" data-noexport id="create-record-objects">create record objects</dfn> from <var>records</var> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②">list</a> of <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record⑤">background fetch records</a>) in <var>realm</var> (a <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#realm" id="ref-for-realm①">Realm</a>), run these steps: 
    <p>All platform objects must be created in <var>realm</var>.</p>
    <ol>
     <li data-md>
      <p>Let <var>recordObjects</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list③">list</a>.</p>
     <li data-md>
      <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate②">For each</a> <var>record</var> of <var>records</var>:</p>
      <ol>
       <li data-md>
        <p>Let <var>responseData</var> be <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-response-data" id="ref-for-background-fetch-record-response-data④">response data</a>.</p>
       <li data-md>
        <p>Let <var>recordObject</var> be a new <code class="idl"><a data-link-type="idl" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord">BackgroundFetchRecord</a></code>.</p>
       <li data-md>
        <p>Set <var>recordObject</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchrecord-responseready" id="ref-for-dom-backgroundfetchrecord-responseready">responseReady</a></code> to <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise">a new promise</a>.</p>
       <li data-md>
        <p>Let <var>requestObject</var> be a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request">Request</a></code> object with the following set:</p>
        <dl>
         <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request">Request</a>
         <dd data-md>
          <p>A copy of <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-request" id="ref-for-background-fetch-record-request②">request</a>, including its <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body①">body</a>.</p>
         <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#request-headers" id="ref-for-request-headers">Headers</a>
         <dd data-md>
          <p>A new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#headers" id="ref-for-headers">Headers</a></code> object associated with this <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①">Request</a></code>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①">request</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-header-list" id="ref-for-concept-request-header-list">header list</a>.</p>
        </dl>
       <li data-md>
        <p>Set <var>recordObject</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchrecord-request" id="ref-for-dom-backgroundfetchrecord-request">request</a></code> to <var>requestObject</var>.</p>
       <li data-md>
        <p>Let <var>transmittedBytes</var> be 0.</p>
       <li data-md>
        <p>Let <var>stream</var> be <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-construct-readablestream" id="ref-for-concept-construct-readablestream">a new readable stream</a> with a pull action that returns <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise①">a new promise</a> <var>promise</var> and runs these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>:</p>
        <ol>
         <li data-md>
          <p>Wait for the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length③">length</a> of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes⑤">bytes</a> to be greater than <var>transmittedBytes</var>, or <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①④">result</a> not to be the empty string.</p>
         <li data-md>
          <p>Let <var>bytes</var> be null.</p>
         <li data-md>
          <p>If the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length④">length</a> of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes⑥">bytes</a> is greater than <var>transmittedBytes</var> and <var>responseData</var> may be <a data-link-type="dfn" href="#background-fetch-response-exposed" id="ref-for-background-fetch-response-exposed">exposed</a>, then:</p>
          <ol>
           <li data-md>
            <p>Set <var>bytes</var> to a user agent determined slice of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes⑦">bytes</a>, starting from an offset of <var>transmittedBytes</var>.</p>
            <p class="note" role="note"><span>Note:</span> This allows the user agent to stream the resource from storage at an appropriate rate.</p>
           <li data-md>
            <p>Increment <var>transmittedBytes</var> by <var>bytes</var>’ <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length⑤">length</a>.</p>
          </ol>
         <li data-md>
          <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①">Queue a task</a> in <var>stream</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop②">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source" id="ref-for-networking-task-source">networking task source</a> to run these steps:</p>
          <ol>
           <li data-md>
            <p>If <var>bytes</var> is not null, then:</p>
            <ol>
             <li data-md>
              <p>Let <var>array</var> be a new <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-Uint8Array" id="ref-for-idl-Uint8Array">Uint8Array</a></code> wrapping a new <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-ArrayBuffer" id="ref-for-idl-ArrayBuffer">ArrayBuffer</a></code> of <var>bytes</var>.</p>
             <li data-md>
              <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-enqueue-readablestream" id="ref-for-concept-enqueue-readablestream">Enqueue</a> <var>array</var> into <var>stream</var>.</p>
            </ol>
           <li data-md>
            <p>If <var>responseData</var> may be <a data-link-type="dfn" href="#background-fetch-response-exposed" id="ref-for-background-fetch-response-exposed①">exposed</a>, <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①⑤">result</a> is not the empty string, and <var>transmittedBytes</var> is the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence-length" id="ref-for-byte-sequence-length⑥">length</a> of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-bytes" id="ref-for-background-fetch-response-bytes⑧">bytes</a>, then <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-closed" id="ref-for-concept-readablestream-closed">close</a> <var>stream</var>.</p>
           <li data-md>
            <p>Otherwise, if <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①⑥">result</a> is <code>"aborted"</code>, then <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored①">error</a> <var>stream</var> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#aborterror" id="ref-for-aborterror">AbortError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException">DOMException</a></code>.</p>
           <li data-md>
            <p>Otherwise, if <var>responseData</var> may not be <a data-link-type="dfn" href="#background-fetch-response-exposed" id="ref-for-background-fetch-response-exposed②">exposed</a>, then <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored②">error</a> <var>stream</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror">TypeError</a></code>.</p>
           <li data-md>
            <p><a data-link-type="dfn">Resolve</a> <var>promise</var>.</p>
          </ol>
        </ol>
       <li data-md>
        <p>Run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a>:</p>
        <ol>
         <li data-md>
          <p>Wait for <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-response" id="ref-for-background-fetch-response-response③">response</a> to not be not-null.</p>
         <li data-md>
          <p>If <var>responseData</var> may be <a data-link-type="dfn" href="#background-fetch-response-exposed" id="ref-for-background-fetch-response-exposed③">exposed</a>, then:</p>
          <ol>
           <li data-md>
            <p>Let <var>response</var> be a copy of <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-response" id="ref-for-background-fetch-response-response④">response</a>.</p>
           <li data-md>
            <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-delete" id="ref-for-concept-header-list-delete">Delete</a> `<code>Content-Range</code>` from <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑤">header list</a>.</p>
           <li data-md>
            <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-list-delete" id="ref-for-concept-header-list-delete①">Delete</a> `<code>Content-Length</code>` from <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑥">header list</a>.</p>
           <li data-md>
            <p>Let <var>body</var> be a new <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body" id="ref-for-concept-body">body</a> with <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream①">stream</a> set to <var>stream</var>.</p>
           <li data-md>
            <p>Set <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body②">body</a> to <var>body</var>.</p>
           <li data-md>
            <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②">Queue a task</a> in <var>recordObject</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object②">relevant settings object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop③">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source" id="ref-for-networking-task-source①">networking task source</a> to run these steps:</p>
            <ol>
             <li data-md>
              <p>Let <var>responseObject</var> be a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response">Response</a></code> object with the following set:</p>
              <dl>
               <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response">Response</a>
               <dd data-md>
                <p><var>response</var>.</p>
               <dt data-md><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#response-headers" id="ref-for-response-headers">Headers</a>
               <dd data-md>
                <p>A new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#headers" id="ref-for-headers①">Headers</a></code> object associated with this <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①">Response</a></code>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response①">response</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list⑦">header list</a>.</p>
              </dl>
             <li data-md>
              <p><a data-link-type="dfn">Resolve</a> <var>recordObject</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchrecord-responseready" id="ref-for-dom-backgroundfetchrecord-responseready①">responseReady</a></code> with <var>responseObject</var>.</p>
            </ol>
          </ol>
         <li data-md>
          <p>Otherwise, if <var>responseData</var>’s <a data-link-type="dfn" href="#background-fetch-response-result" id="ref-for-background-fetch-response-result①⑦">result</a> is <code>"aborted"</code>, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise">reject</a> <var>recordObject</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchrecord-responseready" id="ref-for-dom-backgroundfetchrecord-responseready②">responseReady</a></code> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#aborterror" id="ref-for-aborterror①">AbortError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException①">DOMException</a></code>.</p>
         <li data-md>
          <p>Otherwise, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise①">reject</a> <var>recordObject</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchrecord-responseready" id="ref-for-dom-backgroundfetchrecord-responseready③">responseReady</a></code> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①">TypeError</a></code>.</p>
        </ol>
       <li data-md>
        <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append">Append</a> <var>recordObject</var> to <var>recordObjects</var>.</p>
      </ol>
     <li data-md>
      <p>Return <var>recordObjects</var>.</p>
    </ol>
   </div>
   <h3 class="heading settled" data-level="4.9" id="contains-background-fetch-algorithm"><span class="secno">4.9. </span><span class="content"><a data-link-type="dfn" href="#contains-background-fetch" id="ref-for-contains-background-fetch①">Contains background fetch</a></span><a class="self-link" href="#contains-background-fetch-algorithm"></a></h3>
   <div class="algorithm" data-algorithm="contains background fetch">
     To determine whether a <var>map</var> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map②">map</a>) <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="contains-background-fetch">contains background fetch</dfn> <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①②">background fetch</a>), run these steps: 
    <ol>
     <li data-md>
      <p>Let <var>id</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-id" id="ref-for-background-fetch-id①">id</a>.</p>
     <li data-md>
      <p>If <var>map</var>[<var>id</var>] does not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists①">exist</a>, then return false.</p>
     <li data-md>
      <p>If <var>map</var>[<var>id</var>] does not equal <var>bgFetch</var>, then return false.</p>
     <li data-md>
      <p>Return true.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="does not contain background fetch">
     To determine whether a <var>map</var> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map③">map</a>) <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="does-not-contain-background-fetch">does not contain background fetch</dfn> <var>bgFetch</var> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①③">background fetch</a>), run these steps: 
    <ol>
     <li data-md>
      <p>If <var>map</var> <a data-link-type="dfn" href="#contains-background-fetch" id="ref-for-contains-background-fetch②">contains background fetch</a> <var>bgFetch</var>, then return false.</p>
     <li data-md>
      <p>Return true.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="5" id="header-syntax"><span class="secno">5. </span><span class="content">Header syntax</span><a class="self-link" href="#header-syntax"></a></h2>
   <p>The following is <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7230#section-7" id="ref-for-section-7">HTTP ABNF</a> for a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="single-byte-content-range">single byte content-range</dfn>:</p>
<pre>"bytes=" first-byte-pos "-" last-byte-pos "/" complete-length
first-byte-pos = 1*DIGIT
last-byte-pos  = 1*DIGIT
complete-length = ( 1*DIGIT / "*" )</pre>
   <p class="note" role="note"><span>Note:</span> This is a subset of what <a href="https://tools.ietf.org/html/rfc7233#section-3.1">RFC 7233</a> allows.</p>
   <div class="note" role="note">
    <p>The above as a railroad diagram:</p>
    <div class="railroad">
     <svg class="railroad-diagram" height="197" viewBox="0 0 651 197" width="651">
      <g transform="translate(.5 .5)">
       <path d="M 20 21 v 20 m 10 -20 v 20 m -10 -10 h 20.5"></path>
       <path d="M40 31h10"></path>
       <g class="terminal">
        <path d="M50 31h0"></path>
        <path d="M134 31h0"></path>
        <rect height="22" rx="10" ry="10" width="84" x="50" y="20"></rect>
        <text x="92" y="35">"bytes="</text>
       </g>
       <path d="M134 31h10"></path>
       <path d="M144 31h10"></path>
       <g>
        <path d="M154 31h0"></path>
        <path d="M154 31h10"></path>
        <g>
         <path d="M164 31h10"></path>
         <path d="M581 31h10"></path>
         <g>
          <path d="M174 31h0"></path>
          <path d="M282 31h0"></path>
          <text class="comment" x="228" y="36">first-byte-pos</text>
         </g>
         <path d="M282 31h10"></path>
         <path d="M292 31h10"></path>
         <g>
          <path d="M302 31h0"></path>
          <path d="M382 31h0"></path>
          <path d="M302 31h10"></path>
          <g class="non-terminal">
           <path d="M312 31h0"></path>
           <path d="M372 31h0"></path>
           <rect height="22" width="60" x="312" y="20"></rect>
           <text x="342" y="35">digit</text>
          </g>
          <path d="M372 31h10"></path>
          <path d="M312 31a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path>
          <g>
           <path d="M312 51h60"></path>
          </g>
          <path d="M372 51a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path>
         </g>
         <path d="M382 31h10"></path>
         <path d="M392 31h10"></path>
         <g>
          <path d="M402 31h0"></path>
          <path d="M517 31h0"></path>
          <text class="comment" x="459" y="36">/first-byte-pos</text>
         </g>
         <path d="M517 31h10"></path>
         <path d="M527 31h10"></path>
         <g class="non-terminal">
          <path d="M537 31h0"></path>
          <path d="M581 31h0"></path>
          <rect height="22" width="44" x="537" y="20"></rect>
          <text x="559" y="35">"/"</text>
         </g>
        </g>
        <path d="M591 31a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-427a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path>
        <g>
         <path d="M164 79h17"></path>
         <path d="M574 79h17"></path>
         <g>
          <path d="M181 79h0"></path>
          <path d="M282 79h0"></path>
          <text class="comment" x="231" y="84">last-byte-pos</text>
         </g>
         <path d="M282 79h10"></path>
         <path d="M292 79h10"></path>
         <g>
          <path d="M302 79h0"></path>
          <path d="M382 79h0"></path>
          <path d="M302 79h10"></path>
          <g class="non-terminal">
           <path d="M312 79h0"></path>
           <path d="M372 79h0"></path>
           <rect height="22" width="60" x="312" y="68"></rect>
           <text x="342" y="83">digit</text>
          </g>
          <path d="M372 79h10"></path>
          <path d="M312 79a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path>
          <g>
           <path d="M312 99h60"></path>
          </g>
          <path d="M372 99a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path>
         </g>
         <path d="M382 79h10"></path>
         <path d="M392 79h10"></path>
         <g>
          <path d="M402 79h0"></path>
          <path d="M510 79h0"></path>
          <text class="comment" x="456" y="84">/last-byte-pos</text>
         </g>
         <path d="M510 79h10"></path>
         <path d="M520 79h10"></path>
         <g class="non-terminal">
          <path d="M530 79h0"></path>
          <path d="M574 79h0"></path>
          <rect height="22" width="44" x="530" y="68"></rect>
          <text x="552" y="83">"/"</text>
         </g>
        </g>
        <path d="M591 79a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-427a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path>
        <g>
         <path d="M164 127h25"></path>
         <path d="M566 127h25"></path>
         <g>
          <path d="M189 127h0"></path>
          <path d="M304 127h0"></path>
          <text class="comment" x="246" y="132">complete-length</text>
         </g>
         <path d="M304 127h10"></path>
         <g>
          <path d="M314 127h0"></path>
          <path d="M434 127h0"></path>
          <path d="M314 127h20"></path>
          <g class="non-terminal">
           <path d="M334 127h18"></path>
           <path d="M396 127h18"></path>
           <rect height="22" width="44" x="352" y="116"></rect>
           <text x="374" y="131">"*"</text>
          </g>
          <path d="M414 127h20"></path>
          <path d="M314 127a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path>
          <g>
           <path d="M334 157h0"></path>
           <path d="M414 157h0"></path>
           <path d="M334 157h10"></path>
           <g class="non-terminal">
            <path d="M344 157h0"></path>
            <path d="M404 157h0"></path>
            <rect height="22" width="60" x="344" y="146"></rect>
            <text x="374" y="161">digit</text>
           </g>
           <path d="M404 157h10"></path>
           <path d="M344 157a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path>
           <g>
            <path d="M344 177h60"></path>
           </g>
           <path d="M404 177a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path>
          </g>
          <path d="M414 157a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path>
         </g>
         <path d="M434 127h10"></path>
         <g>
          <path d="M444 127h0"></path>
          <path d="M566 127h0"></path>
          <text class="comment" x="505" y="132">/complete-length</text>
         </g>
        </g>
        <path d="M591 127h10"></path>
        <path d="M601 127h0"></path>
       </g>
       <path d="M601 127h10"></path>
       <path d="M 611 127 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
      </g>
     </svg>
    </div>
   </div>
   <h2 class="heading settled" data-level="6" id="api"><span class="secno">6. </span><span class="content">API</span><a class="self-link" href="#api"></a></h2>
   <h3 class="heading settled" data-level="6.1" id="extensions-to-service-worker-global"><span class="secno">6.1. </span><span class="content">Extensions to <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope">ServiceWorkerGlobalScope</a></code></span><a class="self-link" href="#extensions-to-service-worker-global"></a></h3>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope①"><c- g>ServiceWorkerGlobalScope</c-></a> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-serviceworkerglobalscope-onbackgroundfetchsuccess"><code><c- g>onbackgroundfetchsuccess</c-></code></dfn>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-serviceworkerglobalscope-onbackgroundfetchfail"><code><c- g>onbackgroundfetchfail</c-></code></dfn>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-serviceworkerglobalscope-onbackgroundfetchabort"><code><c- g>onbackgroundfetchabort</c-></code></dfn>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③"><c- n>EventHandler</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export data-type="EventHandler" id="dom-serviceworkerglobalscope-onbackgroundfetchclick"><code><c- g>onbackgroundfetchclick</c-></code></dfn>;
};
</pre>
   <h4 class="heading settled" data-level="6.1.1" id="service-worker-global-events"><span class="secno">6.1.1. </span><span class="content">Events</span><a class="self-link" href="#service-worker-global-events"></a></h4>
   <p>The following is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers">event handler</a> (and its corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type">event handler event type</a>) that must be supported, as <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes">event handler IDL attributes</a>, by all objects implementing <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworker" id="ref-for-serviceworker">ServiceWorker</a></code> interface:</p>
   <table class="data">
    <thead>
     <tr>
      <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type①">event handler event type</a>
      <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers①">event handler</a>
      <th>Interface
    <tbody>
     <tr>
      <td><dfn class="idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="eventdef-serviceworkerglobalscope-backgroundfetchsuccess"><code>backgroundfetchsuccess</code><a class="self-link" href="#eventdef-serviceworkerglobalscope-backgroundfetchsuccess"></a></dfn>
      <td><code class="idl"><a data-link-type="idl" href="#dom-serviceworkerglobalscope-onbackgroundfetchsuccess" id="ref-for-dom-serviceworkerglobalscope-onbackgroundfetchsuccess">onbackgroundfetchsuccess</a></code>
      <td><code class="idl"><a data-link-type="idl" href="#backgroundfetchupdateuievent" id="ref-for-backgroundfetchupdateuievent②">BackgroundFetchUpdateUIEvent</a></code>
     <tr>
      <td><dfn class="idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="eventdef-serviceworkerglobalscope-backgroundfetchfail"><code>backgroundfetchfail</code><a class="self-link" href="#eventdef-serviceworkerglobalscope-backgroundfetchfail"></a></dfn>
      <td><code class="idl"><a data-link-type="idl" href="#dom-serviceworkerglobalscope-onbackgroundfetchfail" id="ref-for-dom-serviceworkerglobalscope-onbackgroundfetchfail">onbackgroundfetchfail</a></code>
      <td><code class="idl"><a data-link-type="idl" href="#backgroundfetchupdateuievent" id="ref-for-backgroundfetchupdateuievent③">BackgroundFetchUpdateUIEvent</a></code>
     <tr>
      <td><dfn class="idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="eventdef-serviceworkerglobalscope-backgroundfetchabort"><code>backgroundfetchabort</code><a class="self-link" href="#eventdef-serviceworkerglobalscope-backgroundfetchabort"></a></dfn>
      <td><code class="idl"><a data-link-type="idl" href="#dom-serviceworkerglobalscope-onbackgroundfetchabort" id="ref-for-dom-serviceworkerglobalscope-onbackgroundfetchabort">onbackgroundfetchabort</a></code>
      <td><code class="idl"><a data-link-type="idl" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent②">BackgroundFetchEvent</a></code>
     <tr>
      <td><dfn class="idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="eventdef-serviceworkerglobalscope-backgroundfetchclick"><code>backgroundfetchclick</code><a class="self-link" href="#eventdef-serviceworkerglobalscope-backgroundfetchclick"></a></dfn>
      <td><code class="idl"><a data-link-type="idl" href="#dom-serviceworkerglobalscope-onbackgroundfetchclick" id="ref-for-dom-serviceworkerglobalscope-onbackgroundfetchclick">onbackgroundfetchclick</a></code>
      <td><code class="idl"><a data-link-type="idl" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent③">BackgroundFetchEvent</a></code>
   </table>
   <h3 class="heading settled" data-level="6.2" id="extensions-to-service-worker-registration"><span class="secno">6.2. </span><span class="content">Extensions to <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworkerregistration" id="ref-for-serviceworkerregistration">ServiceWorkerRegistration</a></code></span><a class="self-link" href="#extensions-to-service-worker-registration"></a></h3>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://w3c.github.io/ServiceWorker/#serviceworkerregistration" id="ref-for-serviceworkerregistration①"><c- g>ServiceWorkerRegistration</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager②"><c- n>BackgroundFetchManager</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchManager" href="#dom-serviceworkerregistration-backgroundfetch" id="ref-for-dom-serviceworkerregistration-backgroundfetch"><c- g>backgroundFetch</c-></a>;
};
</pre>
   <div>
    <p>A <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/ServiceWorker/#serviceworkerregistration" id="ref-for-serviceworkerregistration②">ServiceWorkerRegistration</a></code> has a <dfn class="dfn-paneled" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="dfn" data-noexport id="serviceworkerregistration-background-fetch-manager">background fetch manager</dfn> (a <code class="idl"><a data-link-type="idl" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager③">BackgroundFetchManager</a></code>), initially a new <code class="idl"><a data-link-type="idl" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager④">BackgroundFetchManager</a></code> whose <a data-link-type="dfn" href="#backgroundfetchmanager-service-worker-registration" id="ref-for-backgroundfetchmanager-service-worker-registration">service worker registration</a> is the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②">context object</a>'s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②">service worker registration</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="attribute" data-export id="dom-serviceworkerregistration-backgroundfetch"><code>backgroundFetch</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③">context object</a>'s <a data-link-type="dfn" href="#serviceworkerregistration-background-fetch-manager" id="ref-for-serviceworkerregistration-background-fetch-manager">background fetch manager</a>.</p>
   </div>
   <h3 class="heading settled" data-level="6.3" id="background-fetch-manager"><span class="secno">6.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager⑤">BackgroundFetchManager</a></code></span><a class="self-link" href="#background-fetch-manager"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="backgroundfetchmanager"><code><c- g>BackgroundFetchManager</c-></code></dfn> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration③"><c- n>BackgroundFetchRegistration</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchmanager-fetch" id="ref-for-dom-backgroundfetchmanager-fetch"><c- g>fetch</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchManager/fetch(id, requests, options), BackgroundFetchManager/fetch(id, requests)" data-dfn-type="argument" data-export id="dom-backgroundfetchmanager-fetch-id-requests-options-id"><code><c- g>id</c-></code><a class="self-link" href="#dom-backgroundfetchmanager-fetch-id-requests-options-id"></a></dfn>, (<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo"><c- n>RequestInfo</c-></a> <c- b>or</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo①"><c- n>RequestInfo</c-></a>>) <dfn class="idl-code" data-dfn-for="BackgroundFetchManager/fetch(id, requests, options), BackgroundFetchManager/fetch(id, requests)" data-dfn-type="argument" data-export id="dom-backgroundfetchmanager-fetch-id-requests-options-requests"><code><c- g>requests</c-></code><a class="self-link" href="#dom-backgroundfetchmanager-fetch-id-requests-options-requests"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetchoptions" id="ref-for-dictdef-backgroundfetchoptions"><c- n>BackgroundFetchOptions</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchManager/fetch(id, requests, options), BackgroundFetchManager/fetch(id, requests)" data-dfn-type="argument" data-export id="dom-backgroundfetchmanager-fetch-id-requests-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-backgroundfetchmanager-fetch-id-requests-options-options"></a></dfn> = {});
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration④"><c- n>BackgroundFetchRegistration</c-></a>?> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchmanager-get" id="ref-for-dom-backgroundfetchmanager-get"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchManager/get(id)" data-dfn-type="argument" data-export id="dom-backgroundfetchmanager-get-id-id"><code><c- g>id</c-></code><a class="self-link" href="#dom-backgroundfetchmanager-get-id-id"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②"><c- b>DOMString</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchmanager-getids" id="ref-for-dom-backgroundfetchmanager-getids"><c- g>getIds</c-></a>();
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-backgroundfetchuioptions"><code><c- g>BackgroundFetchUIOptions</c-></code></dfn> {
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/appmanifest/#dom-imageresource" id="ref-for-dom-imageresource②"><c- n>ImageResource</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchUIOptions" data-dfn-type="dict-member" data-export data-type="sequence<ImageResource> " id="dom-backgroundfetchuioptions-icons"><code><c- g>icons</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString③"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchUIOptions" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-backgroundfetchuioptions-title"><code><c- g>title</c-></code></dfn>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-backgroundfetchoptions"><code><c- g>BackgroundFetchOptions</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetchuioptions" id="ref-for-dictdef-backgroundfetchuioptions"><c- n>BackgroundFetchUIOptions</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <dfn class="idl-code" data-default="0" data-dfn-for="BackgroundFetchOptions" data-dfn-type="dict-member" data-export data-type="unsigned long long " id="dom-backgroundfetchoptions-downloadtotal"><code><c- g>downloadTotal</c-></code><a class="self-link" href="#dom-backgroundfetchoptions-downloadtotal"></a></dfn> = 0;
};
</pre>
   <div>
    <p>A <code class="idl"><a data-link-type="idl" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager⑥">BackgroundFetchManager</a></code> has:</p>
    <div>
     <ul>
      <li data-md>
       <p><dfn class="dfn-paneled" data-dfn-for="BackgroundFetchManager" data-dfn-type="dfn" data-noexport id="backgroundfetchmanager-backgroundfetchregistration-instances">BackgroundFetchRegistration instances</dfn> (a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map④">map</a>), where the keys are <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①④">background fetches</a> and the values are <code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration⑤">BackgroundFetchRegistration</a></code> objects. It is initially an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ordered-map" id="ref-for-ordered-map⑤">map</a>.</p>
      <li data-md>
       <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchManager" data-dfn-type="dfn" data-noexport id="backgroundfetchmanager-service-worker-registration">service worker registration</dfn> (a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③">service worker registration</a>).</p>
     </ul>
    </div>
    <h4 class="heading settled" data-level="6.3.1" id="background-fetch-manager-fetch"><span class="secno">6.3.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchmanager-fetch" id="ref-for-dom-backgroundfetchmanager-fetch①">fetch()</a></code></span><a class="self-link" href="#background-fetch-manager-fetch"></a></h4>
    <div class="algorithm" data-algorithm="fetch(id, requests, options)">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchManager" data-dfn-type="method" data-export data-lt="fetch(id, requests, options)|fetch(id, requests)" id="dom-backgroundfetchmanager-fetch"><code>fetch(<var>id</var>, <var>requests</var>, <var>options</var>)</code></dfn> method, when invoked, run these steps: 
     <ol>
      <li data-md>
       <p>Let <var>registration</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object④">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchmanager-service-worker-registration" id="ref-for-backgroundfetchmanager-service-worker-registration①">service worker registration</a>.</p>
      <li data-md>
       <p>Let <var>records</var> be a new <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list④">list</a>.</p>
      <li data-md>
       <p>Let <var>uploadTotal</var> be 0.</p>
      <li data-md>
       <p>If <var>requests</var> is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo②">RequestInfo</a></code>, set <var>requests</var> to « <var>requests</var> ».</p>
      <li data-md>
       <p>If <var>requests</var> is <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-empty" id="ref-for-list-empty">empty</a>, then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②">TypeError</a></code>.</p>
      <li data-md>
       <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate③">For each</a> <var>request</var> of <var>requests</var>:</p>
       <ol>
        <li data-md>
         <p>Let <var>internalRequest</var> be the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request②">request</a> of the result of invoking the <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②">Request</a></code> constructor with <var>request</var>. If this throws an exception, return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①">a promise rejected with</a> the exception.</p>
        <li data-md>
         <p>If <var>internalRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-mode" id="ref-for-concept-request-mode①">mode</a> is "<code>no-cors</code>", then return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with②">a promise rejected with</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror③">TypeError</a></code>.</p>
        <li data-md>
         <p>Set <var>internalRequest</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client①">client</a> to null.</p>
        <li data-md>
         <p>Let <var>record</var> be a new <a data-link-type="dfn" href="#background-fetch-record" id="ref-for-background-fetch-record⑥">background fetch record</a>.</p>
        <li data-md>
         <p>Set <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-request" id="ref-for-background-fetch-record-request③">request</a> to <var>internalRequest</var>.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append①">Append</a> <var>record</var> to <var>records</var>.</p>
       </ol>
      <li data-md>
       <p>Let <var>promise</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise②">a new promise</a>.</p>
      <li data-md>
       <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps②">Enqueue the following steps</a> to <var>registration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches-edit-queue" id="ref-for-service-worker-registration-active-background-fetches-edit-queue①">active background fetches edit queue</a>:</p>
       <ol>
        <li data-md>
         <p>Let <var>permission</var> be the <a data-link-type="dfn" href="https://w3c.github.io/permissions/#permission-state" id="ref-for-permission-state①">permission state</a> for a <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①">PermissionDescriptor</a></code> with <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①">name</a></code> <code>"background-fetch"</code>, and the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑤">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object③">relevant settings object</a>.</p>
        <li data-md>
         <p>If <var>permission</var> is <code>"denied"</code>, then reject <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notallowederror" id="ref-for-notallowederror">NotAllowedError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException②">DOMException</a></code> and abort these steps.</p>
        <li data-md>
         <p>Let <var>bgFetchMap</var> be <var>registration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches" id="ref-for-service-worker-registration-active-background-fetches①">active background fetches</a>.</p>
        <li data-md>
         <p>If <var>registration</var>’s <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-active-worker" id="ref-for-dfn-active-worker">active worker</a> is null, then reject <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror④">TypeError</a></code> and abort these steps.</p>
        <li data-md>
         <p>If <var>bgFetchMap</var>[<var>id</var>] <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-exists" id="ref-for-map-exists②">exists</a>, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise②">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑤">TypeError</a></code> and abort these steps.</p>
        <li data-md>
         <p>Let <var>requestBodiesRemaining</var> be the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size①">size</a> of <var>requests</var>.</p>
        <li data-md>
         <p>Let <var>requestReadFailed</var> be false.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate④">For each</a> <var>request</var> of <var>requests</var>:</p>
         <ol>
          <li data-md>
           <p>If <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body②">body</a> is null, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue">continue</a>.</p>
          <li data-md>
           <p>Let <var>stream</var> be <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body③">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream②">stream</a>.</p>
          <li data-md>
           <p>Run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a>:</p>
           <ol>
            <li data-md>
             <p>Run these steps but <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#abort-when" id="ref-for-abort-when①">abort when</a> <var>requestReadFailed</var> is true:</p>
             <ol>
              <li data-md>
               <p><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-wait" id="ref-for-concept-body-wait">Wait</a> for <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body④">body</a>.</p>
              <li data-md>
               <p>If <var>stream</var> has <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored③">errored</a>, then set <var>requestReadFailed</var> to true.</p>
             </ol>
             <p class="note" role="note"><span>Note:</span> This ensures we have a copy of the request bytes before resolving.</p>
            <li data-md>
             <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#if-aborted" id="ref-for-if-aborted①">If aborted</a> and <var>stream</var> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-readable" id="ref-for-concept-readablestream-readable">readable</a>, then <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored④">error</a> <var>stream</var> with an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#aborterror" id="ref-for-aborterror②">AbortError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException③">DOMException</a></code> and abort these steps.</p>
            <li data-md>
             <p>Increment <var>uploadTotal</var> by <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-body" id="ref-for-concept-request-body⑤">body</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-total-bytes" id="ref-for-concept-body-total-bytes">total bytes</a>.</p>
            <li data-md>
             <p>Decrement <var>requestBodiesRemaining</var> by 1.</p>
           </ol>
         </ol>
        <li data-md>
         <p>If at any point storing <var>requests</var> fails due to exceeding a quota limit, <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise③">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#quotaexceedederror" id="ref-for-quotaexceedederror">QuotaExceededError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException④">DOMException</a></code> and abort these steps.</p>
        <li data-md>
         <p>Wait for <var>requestBodiesRemaining</var> to be 0, or <var>requestReadFailed</var> to be true.</p>
        <li data-md>
         <p>If <var>requestReadFailed</var> is true, then <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise" id="ref-for-reject-promise④">reject</a> <var>promise</var> with a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror⑥">TypeError</a></code> and abort these steps.</p>
        <li data-md>
         <p>Let <var>bgFetch</var> be a new <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①⑤">background fetch</a> with:</p>
         <dl>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-id" id="ref-for-background-fetch-id②">id</a>
          <dd data-md>
           <p><var>id</var>.</p>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records④">records</a>
          <dd data-md>
           <p><var>records</var>.</p>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-download-total" id="ref-for-background-fetch-download-total②">download total</a>
          <dd data-md>
           <p><var>options</var>’ <code>downloadTotal</code> member.</p>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-upload-total" id="ref-for-background-fetch-upload-total①">upload total</a>
          <dd data-md>
           <p><var>uploadTotal</var>.</p>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-icons" id="ref-for-background-fetch-icons①">icons</a>
          <dd data-md>
           <p><var>options</var>’ <code>icons</code> member if present, otherwise an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑤">list</a>.</p>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-title" id="ref-for-background-fetch-title①">title</a>
          <dd data-md>
           <p><var>options</var>’ <code>title</code> member if present, otherwise the empty string.</p>
          <dt data-md><a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration④">service worker registration</a>
          <dd data-md>
           <p><var>registration</var>.</p>
         </dl>
        <li data-md>
         <p>Set <var>bgFetchMap</var>[<var>id</var>] to <var>bgFetch</var>.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="#queue-a-bgfetch-task" id="ref-for-queue-a-bgfetch-task①">Queue a bgfetch task</a> to run these steps:</p>
         <ol>
          <li data-md>
           <p><a data-link-type="dfn">Resolve</a> <var>promise</var> with the result of <a data-link-type="dfn" href="#get-a-backgroundfetchregistration-instance" id="ref-for-get-a-backgroundfetchregistration-instance④">getting a BackgroundFetchRegistration instance</a> for <var>bgFetch</var> in the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑥">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm④">relevant Realm</a>.</p>
         </ol>
        <li data-md>
         <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑤">In parallel</a>, <a data-link-type="dfn" href="#background-fetch-display" id="ref-for-background-fetch-display①">display</a> <var>bgFetch</var> from the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑦">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object④">relevant settings object</a>.</p>
        <li data-md>
         <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑥">In parallel</a>, <a data-link-type="dfn" href="#perform-a-background-fetch" id="ref-for-perform-a-background-fetch①">perform a background fetch</a> with <var>bgFetch</var>.</p>
       </ol>
      <li data-md>
       <p>Return <var>promise</var>.</p>
     </ol>
    </div>
    <h4 class="heading settled" data-level="6.3.2" id="background-fetch-manager-get"><span class="secno">6.3.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchmanager-get" id="ref-for-dom-backgroundfetchmanager-get①">get()</a></code></span><a class="self-link" href="#background-fetch-manager-get"></a></h4>
    <div class="algorithm" data-algorithm="get(id)">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchManager" data-dfn-type="method" data-export id="dom-backgroundfetchmanager-get"><code>get(<var>id</var>)</code></dfn> method, when invoked, must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise③">a new promise</a> <var>promise</var> and run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑦">in parallel</a>: 
     <ol>
      <li data-md>
       <p>Let <var>registration</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑧">context object</a>'s associated <a data-link-type="dfn" href="#backgroundfetchmanager-service-worker-registration" id="ref-for-backgroundfetchmanager-service-worker-registration②">service worker registration</a>.</p>
      <li data-md>
       <p>Let <var>bgFetch</var> be <var>registration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches" id="ref-for-service-worker-registration-active-background-fetches②">active background fetches</a>[<var>id</var>].</p>
      <li data-md>
       <p>If <var>bgFetch</var> is undefined, then <a data-link-type="dfn">resolve</a> <var>promise</var> with undefined and abort these steps.</p>
      <li data-md>
       <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps③">Enqueue the following steps</a> to <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-update-handling-queue" id="ref-for-background-fetch-update-handling-queue①">update handling queue</a>:</p>
       <ol>
        <li data-md>
         <p><a data-link-type="dfn" href="#queue-a-bgfetch-task" id="ref-for-queue-a-bgfetch-task②">Queue a bgfetch task</a> <var>task</var> to run these steps:</p>
         <ol>
          <li data-md>
           <p>Let <var>bgFetchRegistration</var> be the result of <a data-link-type="dfn" href="#get-a-backgroundfetchregistration-instance" id="ref-for-get-a-backgroundfetchregistration-instance⑤">getting a BackgroundFetchRegistration instance</a> for <var>bgFetch</var> in the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑨">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm⑤">relevant Realm</a>.</p>
          <li data-md>
           <p><a data-link-type="dfn">Resolve</a> <var>promise</var> with <var>bgFetchRegistration</var>.</p>
         </ol>
        <li data-md>
         <p>Wait for <var>task</var> to complete.</p>
         <p class="note" role="note"><span>Note:</span> This ensures the potential new instance of <code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration⑥">BackgroundFetchRegistration</a></code> doesn’t miss any <code class="idl"><a class="idl-code" data-link-type="event" href="#eventdef-backgroundfetchregistration-progress" id="ref-for-eventdef-backgroundfetchregistration-progress">progress</a></code> events.</p>
       </ol>
     </ol>
    </div>
    <h4 class="heading settled" data-level="6.3.3" id="background-fetch-manager-get-ids"><span class="secno">6.3.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchmanager-getids" id="ref-for-dom-backgroundfetchmanager-getids①">getIds()</a></code></span><a class="self-link" href="#background-fetch-manager-get-ids"></a></h4>
    <div class="algorithm" data-algorithm="getIds()">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchManager" data-dfn-type="method" data-export id="dom-backgroundfetchmanager-getids"><code>getIds()</code></dfn> method, when invoked, must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise④">a new promise</a> <var>promise</var> and run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑧">in parallel</a>: 
     <ol>
      <li data-md>
       <p>Let <var>registration</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⓪">context object</a>'s associated <a data-link-type="dfn" href="#backgroundfetchmanager-service-worker-registration" id="ref-for-backgroundfetchmanager-service-worker-registration③">service worker registration</a>.</p>
      <li data-md>
       <p><a data-link-type="dfn">Resolve</a> <var>promise</var> with the result of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-getting-the-keys" id="ref-for-map-getting-the-keys">getting the keys</a> of <var>registration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches" id="ref-for-service-worker-registration-active-background-fetches③">active background fetches</a>.</p>
     </ol>
    </div>
   </div>
   <h3 class="heading settled" data-level="6.4" id="background-fetch-registration"><span class="secno">6.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration⑦">BackgroundFetchRegistration</a></code></span><a class="self-link" href="#background-fetch-registration"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="backgroundfetchregistration"><code><c- g>BackgroundFetchRegistration</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString④"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#dom-backgroundfetchregistration-id" id="ref-for-dom-backgroundfetchregistration-id"><c- g>id</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-uploadtotal" id="ref-for-dom-backgroundfetchregistration-uploadtotal"><c- g>uploadTotal</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long②"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-uploaded" id="ref-for-dom-backgroundfetchregistration-uploaded"><c- g>uploaded</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long③"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-downloadtotal" id="ref-for-dom-backgroundfetchregistration-downloadtotal"><c- g>downloadTotal</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long④"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-downloaded" id="ref-for-dom-backgroundfetchregistration-downloaded"><c- g>downloaded</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#enumdef-backgroundfetchresult" id="ref-for-enumdef-backgroundfetchresult①"><c- n>BackgroundFetchResult</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchResult" href="#dom-backgroundfetchregistration-result" id="ref-for-dom-backgroundfetchregistration-result"><c- g>result</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#enumdef-backgroundfetchfailurereason" id="ref-for-enumdef-backgroundfetchfailurereason②"><c- n>BackgroundFetchFailureReason</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchFailureReason" href="#dom-backgroundfetchregistration-failurereason" id="ref-for-dom-backgroundfetchregistration-failurereason"><c- g>failureReason</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-backgroundfetchregistration-recordsavailable" id="ref-for-dom-backgroundfetchregistration-recordsavailable"><c- g>recordsAvailable</c-></a>;

  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-backgroundfetchregistration-onprogress" id="ref-for-dom-backgroundfetchregistration-onprogress"><c- g>onprogress</c-></a>;

  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchregistration-abort" id="ref-for-dom-backgroundfetchregistration-abort②"><c- g>abort</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord①"><c- n>BackgroundFetchRecord</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchregistration-match" id="ref-for-dom-backgroundfetchregistration-match"><c- g>match</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo③"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchRegistration/match(request, options), BackgroundFetchRegistration/match(request)" data-dfn-type="argument" data-export id="dom-backgroundfetchregistration-match-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-backgroundfetchregistration-match-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions" id="ref-for-dictdef-cachequeryoptions"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchRegistration/match(request, options), BackgroundFetchRegistration/match(request)" data-dfn-type="argument" data-export id="dom-backgroundfetchregistration-match-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-backgroundfetchregistration-match-request-options-options"></a></dfn> = {});
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord②"><c- n>BackgroundFetchRecord</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchregistration-matchall" id="ref-for-dom-backgroundfetchregistration-matchall"><c- g>matchAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo④"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchRegistration/matchAll(request, options), BackgroundFetchRegistration/matchAll(request), BackgroundFetchRegistration/matchAll()" data-dfn-type="argument" data-export id="dom-backgroundfetchregistration-matchall-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-backgroundfetchregistration-matchall-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions" id="ref-for-dictdef-cachequeryoptions①"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchRegistration/matchAll(request, options), BackgroundFetchRegistration/matchAll(request), BackgroundFetchRegistration/matchAll()" data-dfn-type="argument" data-export id="dom-backgroundfetchregistration-matchall-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-backgroundfetchregistration-matchall-request-options-options"></a></dfn> = {});
};

<c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-backgroundfetchresult"><code><c- g>BackgroundFetchResult</c-></code></dfn> { <dfn class="idl-code" data-dfn-for="BackgroundFetchResult" data-dfn-type="enum-value" data-export id="dom-backgroundfetchresult"><code><c- s>""</c-></code><a class="self-link" href="#dom-backgroundfetchresult"></a></dfn>, <dfn class="idl-code" data-dfn-for="BackgroundFetchResult" data-dfn-type="enum-value" data-export id="dom-backgroundfetchresult-success"><code><c- s>"success"</c-></code><a class="self-link" href="#dom-backgroundfetchresult-success"></a></dfn>, <dfn class="idl-code" data-dfn-for="BackgroundFetchResult" data-dfn-type="enum-value" data-export id="dom-backgroundfetchresult-failure"><code><c- s>"failure"</c-></code><a class="self-link" href="#dom-backgroundfetchresult-failure"></a></dfn> };

<c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-backgroundfetchfailurereason"><code><c- g>BackgroundFetchFailureReason</c-></code></dfn> {
  // The background fetch has not completed yet, or was successful.
  <dfn class="idl-code" data-dfn-for="BackgroundFetchFailureReason" data-dfn-type="enum-value" data-export id="dom-backgroundfetchfailurereason"><code><c- s>""</c-></code><a class="self-link" href="#dom-backgroundfetchfailurereason"></a></dfn>,
  // The operation was aborted by the user, or abort() was called.
  <dfn class="idl-code" data-dfn-for="BackgroundFetchFailureReason" data-dfn-type="enum-value" data-export id="dom-backgroundfetchfailurereason-aborted"><code><c- s>"aborted"</c-></code><a class="self-link" href="#dom-backgroundfetchfailurereason-aborted"></a></dfn>,
  // A response had a not-ok-status.
  <dfn class="idl-code" data-dfn-for="BackgroundFetchFailureReason" data-dfn-type="enum-value" data-export id="dom-backgroundfetchfailurereason-bad-status"><code><c- s>"bad-status"</c-></code><a class="self-link" href="#dom-backgroundfetchfailurereason-bad-status"></a></dfn>,
  // A fetch failed for other reasons, e.g. CORS, MIX, an invalid partial response,
  // or a general network failure for a fetch that cannot be retried.
  <dfn class="idl-code" data-dfn-for="BackgroundFetchFailureReason" data-dfn-type="enum-value" data-export id="dom-backgroundfetchfailurereason-fetch-error"><code><c- s>"fetch-error"</c-></code><a class="self-link" href="#dom-backgroundfetchfailurereason-fetch-error"></a></dfn>,
  // Storage quota was reached during the operation.
  <dfn class="idl-code" data-dfn-for="BackgroundFetchFailureReason" data-dfn-type="enum-value" data-export id="dom-backgroundfetchfailurereason-quota-exceeded"><code><c- s>"quota-exceeded"</c-></code><a class="self-link" href="#dom-backgroundfetchfailurereason-quota-exceeded"></a></dfn>,
  // The provided downloadTotal was exceeded.
  <dfn class="idl-code" data-dfn-for="BackgroundFetchFailureReason" data-dfn-type="enum-value" data-export id="dom-backgroundfetchfailurereason-download-total-exceeded"><code><c- s>"download-total-exceeded"</c-></code><a class="self-link" href="#dom-backgroundfetchfailurereason-download-total-exceeded"></a></dfn>
};
</pre>
   <div>
    <p>A <code class="idl"><a data-link-type="idl" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration⑧">BackgroundFetchRegistration</a></code> instance has:</p>
    <ul>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-background-fetch">background fetch</dfn> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①⑥">background fetch</a>).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-downloaded">downloaded</dfn> (a number), initially a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch②">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-stored-body-bytes-total" id="ref-for-background-fetch-stored-body-bytes-total③">stored body bytes total</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-uploaded">uploaded</dfn> (a number), initially a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch③">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-uploaded" id="ref-for-background-fetch-uploaded③">uploaded</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-result">result</dfn> (a <code class="idl"><a data-link-type="idl" href="#enumdef-backgroundfetchresult" id="ref-for-enumdef-backgroundfetchresult②">BackgroundFetchResult</a></code>), initially a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch④">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-result" id="ref-for-background-fetch-result⑥">result</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-failure-reason">failure reason</dfn> (a <code class="idl"><a data-link-type="idl" href="#enumdef-backgroundfetchfailurereason" id="ref-for-enumdef-backgroundfetchfailurereason③">BackgroundFetchFailureReason</a></code>), initially a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch⑤">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-failure-reason" id="ref-for-background-fetch-failure-reason②">failure reason</a>.</p>
     <li data-md>
      <p>An <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-id">id</dfn> (a number), a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch⑥">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-id" id="ref-for-background-fetch-id③">id</a>.</p>
     <li data-md>
      <p>An <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-upload-total">upload total</dfn> (a number), a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch⑦">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-upload-total" id="ref-for-background-fetch-upload-total②">upload total</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-download-total">download total</dfn> (a number), a copy of <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch⑧">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-download-total" id="ref-for-background-fetch-download-total③">download total</a>.</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="dfn" data-noexport id="backgroundfetchregistration-records-available-flag">records available flag</dfn> initially set if <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch⑨">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-records-available-flag" id="ref-for-background-fetch-records-available-flag②">records available flag</a> is set, otherwise unset.</p>
    </ul>
    <p class="note" role="note"><span>Note:</span> The above values are copied so they’re available synchronously.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-id"><code>id</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①①">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-id" id="ref-for-backgroundfetchregistration-id">id</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-uploadtotal"><code>uploadTotal</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①②">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-upload-total" id="ref-for-backgroundfetchregistration-upload-total">upload total</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-downloadtotal"><code>downloadTotal</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①③">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-download-total" id="ref-for-backgroundfetchregistration-download-total">download total</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-uploaded"><code>uploaded</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①④">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-uploaded" id="ref-for-backgroundfetchregistration-uploaded②">uploaded</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-downloaded"><code>downloaded</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑤">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-downloaded" id="ref-for-backgroundfetchregistration-downloaded②">downloaded</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-result"><code>result</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑥">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-result" id="ref-for-backgroundfetchregistration-result③">result</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-failurereason"><code>failureReason</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑦">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-failure-reason" id="ref-for-backgroundfetchregistration-failure-reason②">failure reason</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-recordsavailable"><code>recordsAvailable</code></dfn> attribute’s getter must return true if the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑧">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-records-available-flag" id="ref-for-backgroundfetchregistration-records-available-flag②">records available flag</a> is set, otherwise false.</p>
    <h4 class="heading settled" data-level="6.4.1" id="background-fetch-registration-events"><span class="secno">6.4.1. </span><span class="content">Events</span><a class="self-link" href="#background-fetch-registration-events"></a></h4>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="attribute" data-export id="dom-backgroundfetchregistration-onprogress"><code>onprogress</code></dfn> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers②">event handler</a> has the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type②">event handler event type</a> of <code class="idl"><a class="idl-code" data-link-type="event" href="#eventdef-backgroundfetchregistration-progress" id="ref-for-eventdef-backgroundfetchregistration-progress①">progress</a></code>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="event" data-export id="eventdef-backgroundfetchregistration-progress"><code>progress</code></dfn> event uses the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event" id="ref-for-event">Event</a></code> interface.</p>
    <h4 class="heading settled" data-level="6.4.2" id="background-fetch-registration-abort"><span class="secno">6.4.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-abort" id="ref-for-dom-backgroundfetchregistration-abort③">abort()</a></code></span><a class="self-link" href="#background-fetch-registration-abort"></a></h4>
    <div class="algorithm" data-algorithm="abort()">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="method" data-export id="dom-backgroundfetchregistration-abort"><code>abort()</code></dfn> method, when invoked, must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑤">a new promise</a> <var>promise</var> and run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑨">in parallel</a>: 
     <ol>
      <li data-md>
       <p>Let <var>bgFetch</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑨">context object</a>'s associated <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch①⓪">background fetch</a>.</p>
      <li data-md>
       <p>Let <var>swRegistration</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration⑤">service worker registration</a>.</p>
      <li data-md>
       <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps" id="ref-for-enqueue-the-following-steps④">Enqueue the following steps</a> to <var>swRegistration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches-edit-queue" id="ref-for-service-worker-registration-active-background-fetches-edit-queue②">active background fetches edit queue</a>:</p>
       <ol>
        <li data-md>
         <p>Let <var>activeBgFetches</var> be <var>swRegistration</var>’s <a data-link-type="dfn" href="#service-worker-registration-active-background-fetches" id="ref-for-service-worker-registration-active-background-fetches④">active background fetches</a>.</p>
        <li data-md>
         <p>Let <var>id</var> be <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-id" id="ref-for-background-fetch-id④">id</a>.</p>
        <li data-md>
         <p>If <var>activeBgFetches</var> <a data-link-type="dfn" href="#does-not-contain-background-fetch" id="ref-for-does-not-contain-background-fetch">does not contain background fetch</a> <var>bgFetch</var>, then <a data-link-type="dfn">resolve</a> <var>promise</var> with false and abort these steps.</p>
        <li data-md>
         <p>Remove <var>activeBgFetches</var>[<var>id</var>].</p>
        <li data-md>
         <p><a data-link-type="dfn">Resolve</a> <var>promise</var> with true.</p>
        <li data-md>
         <p>Set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-abort-all-flag" id="ref-for-background-fetch-abort-all-flag⑤">abort all flag</a>.</p>
       </ol>
     </ol>
    </div>
    <h4 class="heading settled" data-level="6.4.3" id="background-fetch-registration-match"><span class="secno">6.4.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-match" id="ref-for-dom-backgroundfetchregistration-match①">match()</a></code></span><a class="self-link" href="#background-fetch-registration-match"></a></h4>
    <div class="algorithm" data-algorithm="match(request, options)">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="method" data-export data-lt="match(request, options)|match(request)" id="dom-backgroundfetchregistration-match"><code>match(<var>request</var>, <var>options</var>)</code></dfn> method, when invoked, must run these steps: 
     <ol>
      <li data-md>
       <p>Let <var>promise</var> be the result of calling the algorithm <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-matchall" id="ref-for-dom-backgroundfetchregistration-matchall①">matchAll()</a></code> passing <var>request</var> and <var>options</var>.</p>
      <li data-md>
       <p>Return the result of <a data-link-type="dfn">reacting</a> to <var>promise</var> with a fulfilment handler that, when called with argument <var>matches</var>, returns <var>matches</var>[0].</p>
     </ol>
     <p class="note" role="note"><span>Note:</span> User agents are encouraged to optimise the above so it’s faster than calling <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-matchall" id="ref-for-dom-backgroundfetchregistration-matchall②">matchAll()</a></code>.</p>
    </div>
    <h4 class="heading settled" data-level="6.4.4" id="background-fetch-registration-match-all"><span class="secno">6.4.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchregistration-matchall" id="ref-for-dom-backgroundfetchregistration-matchall③">matchAll()</a></code></span><a class="self-link" href="#background-fetch-registration-match-all"></a></h4>
    <div class="algorithm" data-algorithm="matchAll(request, options)">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRegistration" data-dfn-type="method" data-export data-lt="matchAll(request, options)|matchAll(request)|matchAll()" id="dom-backgroundfetchregistration-matchall"><code>matchAll(<var>request</var>, <var>options</var>)</code></dfn> method, when invoked, must run these steps: 
     <ol>
      <li data-md>
       <p>If the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⓪">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-records-available-flag" id="ref-for-backgroundfetchregistration-records-available-flag③">records available flag</a> is unset, return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with③">a promise rejected with</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror">InvalidStateError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑤">DOMException</a></code>.</p>
      <li data-md>
       <p>Let <var>promise</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑥">a new promise</a>.</p>
      <li data-md>
       <p>Run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⓪">in parallel</a>:</p>
       <ol>
        <li data-md>
         <p>Let <var>matchingRecords</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑥">list</a>.</p>
        <li data-md>
         <p>For each <var>record</var> of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②①">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch①①">background fetch</a>'s <a data-link-type="dfn" href="#background-fetch-records" id="ref-for-background-fetch-records⑤">records</a>:</p>
         <ol>
          <li data-md>
           <p>If <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#request-matches-cached-item" id="ref-for-request-matches-cached-item">request matches cached item</a> for <var>request</var>, <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-request" id="ref-for-background-fetch-record-request④">request</a>, <var>record</var>’s <a data-link-type="dfn" href="#background-fetch-record-response-data" id="ref-for-background-fetch-record-response-data⑤">response data</a>'s <a data-link-type="dfn" href="#background-fetch-response-response" id="ref-for-background-fetch-response-response⑤">response</a>, and <var>options</var> returns true, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append②">append</a> <var>record</var> to <var>matchingRecords</var>.</p>
         </ol>
        <li data-md>
         <p><a data-link-type="dfn" href="#queue-a-bgfetch-task" id="ref-for-queue-a-bgfetch-task③">Queue a bgfetch task</a> to <a data-link-type="dfn">resolve</a> <var>promise</var> with the result of <a data-link-type="dfn" href="#create-record-objects" id="ref-for-create-record-objects②">creating record objects</a> from <var>matchingRecords</var> in the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②②">context object</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm⑥">relevant Realm</a>.</p>
       </ol>
      <li data-md>
       <p>Return <var>promise</var>.</p>
     </ol>
    </div>
   </div>
   <h3 class="heading settled" data-level="6.5" id="background-fetch-record-interface"><span class="secno">6.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord③">BackgroundFetchRecord</a></code></span><a class="self-link" href="#background-fetch-record-interface"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="backgroundfetchrecord"><code><c- g>BackgroundFetchRecord</c-></code></dfn> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request③"><c- n>Request</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Request" href="#dom-backgroundfetchrecord-request" id="ref-for-dom-backgroundfetchrecord-request①"><c- g>request</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response②"><c- n>Response</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Promise<Response>" href="#dom-backgroundfetchrecord-responseready" id="ref-for-dom-backgroundfetchrecord-responseready④"><c- g>responseReady</c-></a>;
};
</pre>
   <div>
     A <code class="idl"><a data-link-type="idl" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord④">BackgroundFetchRecord</a></code> has: 
    <ul>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRecord" data-dfn-type="dfn" data-noexport id="backgroundfetchrecord-request">request</dfn> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request②">request</a>).</p>
     <li data-md>
      <p>A <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchRecord" data-dfn-type="dfn" data-noexport id="backgroundfetchrecord-response-promise">response promise</dfn> (a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise">Promise</a></code> for a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response⑤">response</a>).</p>
    </ul>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRecord" data-dfn-type="attribute" data-export id="dom-backgroundfetchrecord-request"><code>request</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②③">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchrecord-request" id="ref-for-backgroundfetchrecord-request">request</a>.</p>
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchRecord" data-dfn-type="attribute" data-export id="dom-backgroundfetchrecord-responseready"><code>responseReady</code></dfn> attribute’s getter must return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②④">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchrecord-response-promise" id="ref-for-backgroundfetchrecord-response-promise">response promise</a>.</p>
   </div>
   <h3 class="heading settled" data-level="6.6" id="background-fetch-event"><span class="secno">6.6. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent④">BackgroundFetchEvent</a></code></span><a class="self-link" href="#background-fetch-event"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="backgroundfetchevent"><code><c- g>BackgroundFetchEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#extendableevent" id="ref-for-extendableevent"><c- n>ExtendableEvent</c-></a> {
  <dfn class="idl-code" data-dfn-for="BackgroundFetchEvent" data-dfn-type="constructor" data-export data-lt="BackgroundFetchEvent(type, init)|constructor(type, init)" id="dom-backgroundfetchevent-backgroundfetchevent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-backgroundfetchevent-backgroundfetchevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑤"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchEvent/BackgroundFetchEvent(type, init), BackgroundFetchEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-backgroundfetchevent-backgroundfetchevent-type-init-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-backgroundfetchevent-backgroundfetchevent-type-init-type"></a></dfn>, <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetcheventinit" id="ref-for-dictdef-backgroundfetcheventinit"><c- n>BackgroundFetchEventInit</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchEvent/BackgroundFetchEvent(type, init), BackgroundFetchEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-backgroundfetchevent-backgroundfetchevent-type-init-init"><code><c- g>init</c-></code><a class="self-link" href="#dom-backgroundfetchevent-backgroundfetchevent-type-init-init"></a></dfn>);
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration⑨"><c- n>BackgroundFetchRegistration</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchRegistration" href="#dom-backgroundfetchevent-registration" id="ref-for-dom-backgroundfetchevent-registration②"><c- g>registration</c-></a>;
};

<c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-backgroundfetcheventinit"><code><c- g>BackgroundFetchEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit"><c- n>ExtendableEventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration①⓪"><c- n>BackgroundFetchRegistration</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchEventInit" data-dfn-type="dict-member" data-export data-type="BackgroundFetchRegistration " id="dom-backgroundfetcheventinit-registration"><code><c- g>registration</c-></code><a class="self-link" href="#dom-backgroundfetcheventinit-registration"></a></dfn>;
};
</pre>
   <div>
     A <code class="idl"><a data-link-type="idl" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent⑤">BackgroundFetchEvent</a></code> has a <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchEvent" data-dfn-type="dfn" data-noexport id="backgroundfetchevent-background-fetch">background fetch</dfn> (a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①⑦">background fetch</a>), initially the <a data-link-type="dfn" href="#backgroundfetchregistration-background-fetch" id="ref-for-backgroundfetchregistration-background-fetch①②">background fetch</a> of the value <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchevent-registration" id="ref-for-dom-backgroundfetchevent-registration③">registration</a></code> was initialized to. 
    <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchEvent" data-dfn-type="attribute" data-export id="dom-backgroundfetchevent-registration"><code>registration</code></dfn> attribute must return the value it was initialized to.</p>
   </div>
   <h3 class="heading settled" data-level="6.7" id="background-fetch-update-ui-event"><span class="secno">6.7. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#backgroundfetchupdateuievent" id="ref-for-backgroundfetchupdateuievent④">BackgroundFetchUpdateUIEvent</a></code></span><a class="self-link" href="#background-fetch-update-ui-event"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="backgroundfetchupdateuievent"><code><c- g>BackgroundFetchUpdateUIEvent</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent⑥"><c- n>BackgroundFetchEvent</c-></a> {
  <dfn class="idl-code" data-dfn-for="BackgroundFetchUpdateUIEvent" data-dfn-type="constructor" data-export data-lt="BackgroundFetchUpdateUIEvent(type, init)|constructor(type, init)" id="dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent"><code><c- g>constructor</c-></code><a class="self-link" href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑥"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchUpdateUIEvent/BackgroundFetchUpdateUIEvent(type, init), BackgroundFetchUpdateUIEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent-type-init-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent-type-init-type"></a></dfn>, <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetcheventinit" id="ref-for-dictdef-backgroundfetcheventinit①"><c- n>BackgroundFetchEventInit</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchUpdateUIEvent/BackgroundFetchUpdateUIEvent(type, init), BackgroundFetchUpdateUIEvent/constructor(type, init)" data-dfn-type="argument" data-export id="dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent-type-init-init"><code><c- g>init</c-></code><a class="self-link" href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent-type-init-init"></a></dfn>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchupdateuievent-updateui" id="ref-for-dom-backgroundfetchupdateuievent-updateui"><c- g>updateUI</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetchuioptions" id="ref-for-dictdef-backgroundfetchuioptions①"><c- n>BackgroundFetchUIOptions</c-></a> <dfn class="idl-code" data-dfn-for="BackgroundFetchUpdateUIEvent/updateUI(options), BackgroundFetchUpdateUIEvent/updateUI()" data-dfn-type="argument" data-export id="dom-backgroundfetchupdateuievent-updateui-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-backgroundfetchupdateuievent-updateui-options-options"></a></dfn> = {});
};
</pre>
   <div>
    <p>A <code class="idl"><a data-link-type="idl" href="#backgroundfetchupdateuievent" id="ref-for-backgroundfetchupdateuievent⑤">BackgroundFetchUpdateUIEvent</a></code> has an <dfn class="dfn-paneled" data-dfn-for="BackgroundFetchUpdateUIEvent" data-dfn-type="dfn" data-noexport id="backgroundfetchupdateuievent-ui-updated-flag">UI updated flag</dfn> which is initially unset.</p>
    <h4 class="heading settled" data-level="6.7.1" id="background-fetch-update-ui-event-update-ui"><span class="secno">6.7.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchupdateuievent-updateui" id="ref-for-dom-backgroundfetchupdateuievent-updateui①">updateUI()</a></code></span><a class="self-link" href="#background-fetch-update-ui-event-update-ui"></a></h4>
    <div class="algorithm" data-algorithm="updateUI(options)">
      The <dfn class="dfn-paneled idl-code" data-dfn-for="BackgroundFetchUpdateUIEvent" data-dfn-type="method" data-export data-lt="updateUI(options)|updateUI()" id="dom-backgroundfetchupdateuievent-updateui"><code>updateUI(<var>options</var>)</code></dfn> method, when invoked, must return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise" id="ref-for-a-new-promise⑦">a new promise</a> <var>promise</var> and run these steps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①①">in parallel</a>: 
     <ol>
      <li data-md>
       <p>If any of the following is true:</p>
       <ul>
        <li data-md>
         <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑤">context object</a>'s <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-event-istrusted" id="ref-for-dom-event-istrusted">isTrusted</a></code> attribute is false.</p>
        <li data-md>
         <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑥">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchupdateuievent-ui-updated-flag" id="ref-for-backgroundfetchupdateuievent-ui-updated-flag">UI updated flag</a> is set.</p>
        <li data-md>
         <p>The <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑦">context object</a> is not <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#extendableevent-active" id="ref-for-extendableevent-active①">active</a>.</p>
         <p class="issue" id="issue-b420dc4f①"><a class="self-link" href="#issue-b420dc4f①"></a> <a href="https://github.com/w3c/ServiceWorker/pull/1348">ServiceWorker/1348</a>.</p>
       </ul>
       <p>Throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror①">InvalidStateError</a></code> <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMException" id="ref-for-idl-DOMException⑥">DOMException</a></code>.</p>
      <li data-md>
       <p>Set the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑧">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchupdateuievent-ui-updated-flag" id="ref-for-backgroundfetchupdateuievent-ui-updated-flag①">UI updated flag</a>.</p>
      <li data-md>
       <p>If <var>options</var> is null, return.</p>
      <li data-md>
       <p>Let <var>bgFetch</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑨">context object</a>'s <a data-link-type="dfn" href="#backgroundfetchevent-background-fetch" id="ref-for-backgroundfetchevent-background-fetch">background fetch</a>.</p>
      <li data-md>
       <p>If <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchuioptions-icons" id="ref-for-dom-backgroundfetchuioptions-icons">icons</a></code> member is present, set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-icons" id="ref-for-background-fetch-icons②">icons</a> to <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchuioptions-icons" id="ref-for-dom-backgroundfetchuioptions-icons①">icons</a></code>.</p>
      <li data-md>
       <p>If <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchuioptions-title" id="ref-for-dom-backgroundfetchuioptions-title">title</a></code> member is present, set <var>bgFetch</var>’s <a data-link-type="dfn" href="#background-fetch-title" id="ref-for-background-fetch-title②">title</a> to <var>options</var>’s <code class="idl"><a data-link-type="idl" href="#dom-backgroundfetchuioptions-title" id="ref-for-dom-backgroundfetchuioptions-title①">title</a></code>.</p>
      <li data-md>
       <p><a data-link-type="dfn">Resolve</a> <var>promise</var>.</p>
     </ol>
    </div>
   </div>
   <h2 class="heading settled" data-level="7" id="automation"><span class="secno">7. </span><span class="content">Automation</span><a class="self-link" href="#automation"></a></h2>
   <p>For the purposes of user-agent automation and application testing, this document defines the following <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command" id="ref-for-dfn-extension-command">extension command</a> for the <a data-link-type="biblio" href="#biblio-webdriver">[WebDriver]</a> specification.</p>
   <h3 class="heading settled" data-level="7.1" id="automation-click"><span class="secno">7.1. </span><span class="content"><a data-link-type="dfn" href="#background-fetch-click" id="ref-for-background-fetch-click">Click</a></span><a class="self-link" href="#automation-click"></a></h3>
   <div class="algorithm" data-algorithm="background fetch click">
    <table>
     <tbody>
      <tr>
       <th><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method⑥">Method</a>
       <th><a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command-uri-template" id="ref-for-dfn-extension-command-uri-template">URI Template</a>
      <tr>
       <td>POST
       <td>/session/{session id}/backgroundfetch/{<var>id</var>}/click
    </table>
    <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="background-fetch-click">background fetch click</dfn> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command" id="ref-for-dfn-extension-command①">extension command</a> simulates the user activating the <a data-link-type="dfn" href="#background-fetch-display" id="ref-for-background-fetch-display②">display</a> of a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①⑧">background fetch</a>. The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps">remote end steps</a> are:</p>
    <ol>
     <li data-md>
      <p>If the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-top-level-browsing-context" id="ref-for-dfn-current-top-level-browsing-context">current top-level browsing context</a> is <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-no-longer-open" id="ref-for-dfn-no-longer-open">no longer open</a>, then return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-errors" id="ref-for-dfn-errors">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code" id="ref-for-dfn-error-code">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-no-such-window" id="ref-for-dfn-no-such-window">no such window</a>.</p>
     <li data-md>
      <p>Let <var>pageURL</var> be the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-top-level-browsing-context" id="ref-for-dfn-current-top-level-browsing-context①">current top-level browsing context</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document">active document</a>'s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-document-url" id="ref-for-concept-document-url">URL</a>.</p>
     <li data-md>
      <p>Let <var>swRegistration</var> be the <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#match-service-worker-registration" id="ref-for-match-service-worker-registration">matching service worker registration</a> for <var>pageURL</var>.</p>
     <li data-md>
      <p>If <var>swRegistration</var> is null, then return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-errors" id="ref-for-dfn-errors①">WebDriver error</a> with <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status⑥">status</a> <code>400</code> and JSON error code "<code>invalid service worker state</code>".</p>
     <li data-md>
      <p>Let <var>bgFetch</var> be the newest <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch①⑨">background fetch</a> with an <a data-link-type="dfn" href="#background-fetch-id" id="ref-for-background-fetch-id⑤">id</a> of <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-url-variables" id="ref-for-dfn-url-variables">url variable</a> <var>id</var> and a <a data-link-type="dfn" href="#background-fetch-service-worker-registration" id="ref-for-background-fetch-service-worker-registration⑥">service worker registration</a> of <var>swRegistration</var>, or null if none exists.</p>
     <li data-md>
      <p>If <var>bgFetch</var> is null, then return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-errors" id="ref-for-dfn-errors②">WebDriver error</a> with <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status⑦">status</a> <code>404</code> and JSON error code "<code>background fetch not found</code>".</p>
     <li data-md>
      <p><a data-link-type="dfn" href="#fire-a-background-fetch-click-event" id="ref-for-fire-a-background-fetch-click-event②">Fire a background fetch click event</a> for <var>bgFetch</var>.</p>
     <li data-md>
      <p>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-success" id="ref-for-dfn-success">WebDriver success</a>.</p>
    </ol>
   </div>
   <h2 class="heading settled" data-level="8" id="privacy-and-bandwidth-use"><span class="secno">8. </span><span class="content">Privacy and bandwidth usage</span><a class="self-link" href="#privacy-and-bandwidth-use"></a></h2>
   <p>Fetches can be large and take a long time to complete. During this time the user will be fetching data from one or more servers. The user’s IP address, which may change during the operation, could be used to track the user’s location over time.</p>
   <p>To mitigate this, the steps for <a data-link-type="dfn" href="#background-fetch-display" id="ref-for-background-fetch-display③">displaying</a> a <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch②⓪">background fetch</a> require:</p>
   <ul>
    <li data-md>
     <p>Displaying the <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-origin" id="ref-for-concept-url-origin②">origin</a> of the site making the fetch.</p>
    <li data-md>
     <p>The UI cannot be dismissed while the <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch②①">background fetch</a> is active.</p>
    <li data-md>
     <p>Allowing the operation to be easily aborted.</p>
    <li data-md>
     <p>Allowing the operation to start in a paused state, requiring user interaction to begin.</p>
   </ul>
   <p>The steps also allow a user agent to pause the <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch②②">background fetch</a> if the user is on a metered connection.</p>
   <p>All data stored is associated with a particular <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④">service worker registration</a>. Clearing a <a data-link-type="dfn" href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤">service worker registration</a> will clear all associated <a data-link-type="dfn" href="#background-fetch" id="ref-for-background-fetch②③">background fetches</a>.</p>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <p> Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology.
            The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL”
            in the normative parts of this document
            are to be interpreted as described in RFC 2119.
            However, for readability,
            these words do not appear in all uppercase letters in this specification. </p>
   <p> All of the text of this specification is normative
            except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
   <p> Examples in this specification are introduced with the words “for example”
            or are set apart from the normative text with <code>class="example"</code>, like this: </p>
   <div class="example" id="example-example"><a class="self-link" href="#example-example"></a> This is an example of an informative example. </div>
   <p> Informative notes begin with the word “Note”
            and are set apart from the normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note"> Note, this is an informative note. </p>
  </div>
<script>
(function() {
  "use strict";
  var collapseSidebarText = '<span aria-hidden="true">←</span> '
                          + '<span>Collapse Sidebar</span>';
  var expandSidebarText   = '<span aria-hidden="true">→</span> '
                          + '<span>Pop Out Sidebar</span>';
  var tocJumpText         = '<span aria-hidden="true">↑</span> '
                          + '<span>Jump to Table of Contents</span>';

  var sidebarMedia = window.matchMedia('screen and (min-width: 78em)');
  var autoToggle   = function(e){ toggleSidebar(e.matches) };
  if(sidebarMedia.addListener) {
    sidebarMedia.addListener(autoToggle);
  }

  function toggleSidebar(on) {
    if (on == undefined) {
      on = !document.body.classList.contains('toc-sidebar');
    }

    /* Don’t scroll to compensate for the ToC if we’re above it already. */
    var headY = 0;
    var head = document.querySelector('.head');
    if (head) {
      // terrible approx of "top of ToC"
      headY += head.offsetTop + head.offsetHeight;
    }
    var skipScroll = window.scrollY < headY;

    var toggle = document.getElementById('toc-toggle');
    var tocNav = document.getElementById('toc');
    if (on) {
      var tocHeight = tocNav.offsetHeight;
      document.body.classList.add('toc-sidebar');
      document.body.classList.remove('toc-inline');
      toggle.innerHTML = collapseSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, 0 - tocHeight);
      }
      tocNav.focus();
      sidebarMedia.addListener(autoToggle); // auto-collapse when out of room
    }
    else {
      document.body.classList.add('toc-inline');
      document.body.classList.remove('toc-sidebar');
      toggle.innerHTML = expandSidebarText;
      if (!skipScroll) {
        window.scrollBy(0, tocNav.offsetHeight);
      }
      if (toggle.matches(':hover')) {
        /* Unfocus button when not using keyboard navigation,
           because I don’t know where else to send the focus. */
        toggle.blur();
      }
    }
  }

  function createSidebarToggle() {
    /* Create the sidebar toggle in JS; it shouldn’t exist when JS is off. */
    var toggle = document.createElement('a');
      /* This should probably be a button, but appearance isn’t standards-track.*/
    toggle.id = 'toc-toggle';
    toggle.class = 'toc-toggle';
    toggle.href = '#toc';
    toggle.innerHTML = collapseSidebarText;

    sidebarMedia.addListener(autoToggle);
    var toggler = function(e) {
      e.preventDefault();
      sidebarMedia.removeListener(autoToggle); // persist explicit off states
      toggleSidebar();
      return false;
    }
    toggle.addEventListener('click', toggler, false);


    /* Get <nav id=toc-nav>, or make it if we don’t have one. */
    var tocNav = document.getElementById('toc-nav');
    if (!tocNav) {
      tocNav = document.createElement('p');
      tocNav.id = 'toc-nav';
      /* Prepend for better keyboard navigation */
      document.body.insertBefore(tocNav, document.body.firstChild);
    }
    /* While we’re at it, make sure we have a Jump to Toc link. */
    var tocJump = document.getElementById('toc-jump');
    if (!tocJump) {
      tocJump = document.createElement('a');
      tocJump.id = 'toc-jump';
      tocJump.href = '#toc';
      tocJump.innerHTML = tocJumpText;
      tocNav.appendChild(tocJump);
    }

    tocNav.appendChild(toggle);
  }

  var toc = document.getElementById('toc');
  if (toc) {
    createSidebarToggle();
    toggleSidebar(sidebarMedia.matches);

    /* If the sidebar has been manually opened and is currently overlaying the text
       (window too small for the MQ to add the margin to body),
       then auto-close the sidebar once you click on something in there. */
    toc.addEventListener('click', function(e) {
      if(e.target.tagName.toLowerCase() == "a" && document.body.classList.contains('toc-sidebar') && !sidebarMedia.matches) {
        toggleSidebar(false);
      }
    }, false);
  }
  else {
    console.warn("Can’t find Table of Contents. Please use <nav id='toc'> around the ToC.");
  }

  /* Wrap tables in case they overflow */
  var tables = document.querySelectorAll(':not(.overlarge) > table.data, :not(.overlarge) > table.index');
  var numTables = tables.length;
  for (var i = 0; i < numTables; i++) {
    var table = tables[i];
    var wrapper = document.createElement('div');
    wrapper.className = 'overlarge';
    table.parentNode.insertBefore(wrapper, table);
    wrapper.appendChild(table);
  }

})();
</script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li>
    ""
    <ul>
     <li><a href="#dom-backgroundfetchfailurereason">enum-value for BackgroundFetchFailureReason</a><span>, in §6.4</span>
     <li><a href="#dom-backgroundfetchresult">enum-value for BackgroundFetchResult</a><span>, in §6.4</span>
    </ul>
   <li><a href="#dom-backgroundfetchregistration-abort">abort()</a><span>, in §6.4.2</span>
   <li><a href="#background-fetch-abort-all-flag">abort all flag</a><span>, in §3.2</span>
   <li><a href="#dom-backgroundfetchfailurereason-aborted">"aborted"</a><span>, in §6.4</span>
   <li><a href="#service-worker-registration-active-background-fetches">Active background fetches</a><span>, in §3.1</span>
   <li><a href="#service-worker-registration-active-background-fetches-edit-queue">active background fetches edit queue</a><span>, in §3.1</span>
   <li>
    background fetch
    <ul>
     <li><a href="#background-fetch">definition of</a><span>, in §3.2</span>
     <li><a href="#backgroundfetchevent-background-fetch">dfn for BackgroundFetchEvent</a><span>, in §6.6</span>
     <li><a href="#backgroundfetchregistration-background-fetch">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
    </ul>
   <li><a href="#dom-serviceworkerregistration-backgroundfetch">backgroundFetch</a><span>, in §6.2</span>
   <li><a href="#eventdef-serviceworkerglobalscope-backgroundfetchabort">backgroundfetchabort</a><span>, in §6.1.1</span>
   <li><a href="#eventdef-serviceworkerglobalscope-backgroundfetchclick">backgroundfetchclick</a><span>, in §6.1.1</span>
   <li><a href="#background-fetch-click">background fetch click</a><span>, in §7.1</span>
   <li><a href="#backgroundfetchevent">BackgroundFetchEvent</a><span>, in §6.6</span>
   <li><a href="#dictdef-backgroundfetcheventinit">BackgroundFetchEventInit</a><span>, in §6.6</span>
   <li><a href="#dom-backgroundfetchevent-backgroundfetchevent">BackgroundFetchEvent(type, init)</a><span>, in §6.6</span>
   <li><a href="#eventdef-serviceworkerglobalscope-backgroundfetchfail">backgroundfetchfail</a><span>, in §6.1.1</span>
   <li><a href="#enumdef-backgroundfetchfailurereason">BackgroundFetchFailureReason</a><span>, in §6.4</span>
   <li><a href="#serviceworkerregistration-background-fetch-manager">background fetch manager</a><span>, in §6.2</span>
   <li><a href="#backgroundfetchmanager">BackgroundFetchManager</a><span>, in §6.3</span>
   <li><a href="#dictdef-backgroundfetchoptions">BackgroundFetchOptions</a><span>, in §6.3</span>
   <li><a href="#backgroundfetchrecord">BackgroundFetchRecord</a><span>, in §6.5</span>
   <li><a href="#background-fetch-record">background fetch record</a><span>, in §3.3</span>
   <li><a href="#backgroundfetchregistration">BackgroundFetchRegistration</a><span>, in §6.4</span>
   <li><a href="#backgroundfetchmanager-backgroundfetchregistration-instances">BackgroundFetchRegistration instances</a><span>, in §6.3</span>
   <li><a href="#background-fetch-response">Background fetch response</a><span>, in §3.4</span>
   <li><a href="#enumdef-backgroundfetchresult">BackgroundFetchResult</a><span>, in §6.4</span>
   <li><a href="#eventdef-serviceworkerglobalscope-backgroundfetchsuccess">backgroundfetchsuccess</a><span>, in §6.1.1</span>
   <li><a href="#background-fetch-task-source">background fetch task source</a><span>, in §3</span>
   <li><a href="#dictdef-backgroundfetchuioptions">BackgroundFetchUIOptions</a><span>, in §6.3</span>
   <li><a href="#backgroundfetchupdateuievent">BackgroundFetchUpdateUIEvent</a><span>, in §6.7</span>
   <li><a href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent">BackgroundFetchUpdateUIEvent(type, init)</a><span>, in §6.7</span>
   <li><a href="#dom-backgroundfetchfailurereason-bad-status">"bad-status"</a><span>, in §6.4</span>
   <li><a href="#background-fetch-response-bytes">Bytes</a><span>, in §3.4</span>
   <li><a href="#complete-a-record">complete a record</a><span>, in §4.2</span>
   <li>
    constructor(type, init)
    <ul>
     <li><a href="#dom-backgroundfetchevent-backgroundfetchevent">constructor for BackgroundFetchEvent</a><span>, in §6.6</span>
     <li><a href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent">constructor for BackgroundFetchUpdateUIEvent</a><span>, in §6.7</span>
    </ul>
   <li><a href="#contains-background-fetch">contains background fetch</a><span>, in §4.9</span>
   <li><a href="#create-record-objects">create record objects</a><span>, in §4.8</span>
   <li><a href="#create-record-objects">creating record objects</a><span>, in §4.8</span>
   <li><a href="#background-fetch-display">display</a><span>, in §3.2.1</span>
   <li><a href="#does-not-contain-background-fetch">does not contain background fetch</a><span>, in §4.9</span>
   <li>
    downloaded
    <ul>
     <li><a href="#dom-backgroundfetchregistration-downloaded">attribute for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#backgroundfetchregistration-downloaded">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
    </ul>
   <li>
    downloadTotal
    <ul>
     <li><a href="#dom-backgroundfetchregistration-downloadtotal">attribute for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#dom-backgroundfetchoptions-downloadtotal">dict-member for BackgroundFetchOptions</a><span>, in §6.3</span>
    </ul>
   <li>
    download total
    <ul>
     <li><a href="#backgroundfetchregistration-download-total">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-download-total">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li><a href="#dom-backgroundfetchfailurereason-download-total-exceeded">"download-total-exceeded"</a><span>, in §6.4</span>
   <li><a href="#background-fetch-response-exposed">exposed</a><span>, in §3.4</span>
   <li><a href="#extract-content-range-values">extract content-range values</a><span>, in §4.7</span>
   <li><a href="#extract-content-range-values">extracting content-range values</a><span>, in §4.7</span>
   <li><a href="#dom-backgroundfetchresult-failure">"failure"</a><span>, in §6.4</span>
   <li><a href="#dom-backgroundfetchregistration-failurereason">failureReason</a><span>, in §6.4</span>
   <li>
    failure reason
    <ul>
     <li><a href="#backgroundfetchregistration-failure-reason">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-failure-reason">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li><a href="#dom-backgroundfetchfailurereason-fetch-error">"fetch-error"</a><span>, in §6.4</span>
   <li><a href="#dom-backgroundfetchmanager-fetch">fetch(id, requests)</a><span>, in §6.3.1</span>
   <li><a href="#dom-backgroundfetchmanager-fetch">fetch(id, requests, options)</a><span>, in §6.3.1</span>
   <li><a href="#fire-a-background-fetch-click-event">fire a background fetch click event</a><span>, in §4.4</span>
   <li><a href="#get-a-backgroundfetchregistration-instance">get a BackgroundFetchRegistration instance</a><span>, in §4.5</span>
   <li><a href="#dom-backgroundfetchmanager-get">get(id)</a><span>, in §6.3.2</span>
   <li><a href="#dom-backgroundfetchmanager-getids">getIds()</a><span>, in §6.3.3</span>
   <li><a href="#get-a-backgroundfetchregistration-instance">getting a BackgroundFetchRegistration instance</a><span>, in §4.5</span>
   <li><a href="#dom-backgroundfetchuioptions-icons">icons</a><span>, in §6.3</span>
   <li><a href="#background-fetch-icons">Icons</a><span>, in §3.2</span>
   <li>
    id
    <ul>
     <li><a href="#dom-backgroundfetchregistration-id">attribute for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#backgroundfetchregistration-id">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-id">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li><a href="#dom-backgroundfetchregistration-matchall">matchAll()</a><span>, in §6.4.4</span>
   <li><a href="#dom-backgroundfetchregistration-matchall">matchAll(request)</a><span>, in §6.4.4</span>
   <li><a href="#dom-backgroundfetchregistration-matchall">matchAll(request, options)</a><span>, in §6.4.4</span>
   <li><a href="#dom-backgroundfetchregistration-match">match(request)</a><span>, in §6.4.3</span>
   <li><a href="#dom-backgroundfetchregistration-match">match(request, options)</a><span>, in §6.4.3</span>
   <li><a href="#dom-serviceworkerglobalscope-onbackgroundfetchabort">onbackgroundfetchabort</a><span>, in §6.1</span>
   <li><a href="#dom-serviceworkerglobalscope-onbackgroundfetchclick">onbackgroundfetchclick</a><span>, in §6.1</span>
   <li><a href="#dom-serviceworkerglobalscope-onbackgroundfetchfail">onbackgroundfetchfail</a><span>, in §6.1</span>
   <li><a href="#dom-serviceworkerglobalscope-onbackgroundfetchsuccess">onbackgroundfetchsuccess</a><span>, in §6.1</span>
   <li><a href="#dom-backgroundfetchregistration-onprogress">onprogress</a><span>, in §6.4.1</span>
   <li><a href="#background-fetch-paused-flag">paused flag</a><span>, in §3.2</span>
   <li><a href="#perform-a-background-fetch">perform a background fetch</a><span>, in §4.1</span>
   <li><a href="#eventdef-backgroundfetchregistration-progress">progress</a><span>, in §6.4.1</span>
   <li><a href="#queue-a-bgfetch-task">queue a bgfetch task</a><span>, in §3</span>
   <li><a href="#dom-backgroundfetchfailurereason-quota-exceeded">"quota-exceeded"</a><span>, in §6.4</span>
   <li><a href="#background-fetch-records">Records</a><span>, in §3.2</span>
   <li><a href="#dom-backgroundfetchregistration-recordsavailable">recordsAvailable</a><span>, in §6.4</span>
   <li>
    records available flag
    <ul>
     <li><a href="#backgroundfetchregistration-records-available-flag">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-records-available-flag">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li>
    registration
    <ul>
     <li><a href="#dom-backgroundfetchevent-registration">attribute for BackgroundFetchEvent</a><span>, in §6.6</span>
     <li><a href="#dom-backgroundfetcheventinit-registration">dict-member for BackgroundFetchEventInit</a><span>, in §6.6</span>
    </ul>
   <li>
    request
    <ul>
     <li><a href="#dom-backgroundfetchrecord-request">attribute for BackgroundFetchRecord</a><span>, in §6.5</span>
     <li><a href="#backgroundfetchrecord-request">dfn for BackgroundFetchRecord</a><span>, in §6.5</span>
     <li><a href="#background-fetch-record-request">dfn for background fetch record</a><span>, in §3.3</span>
    </ul>
   <li><a href="#background-fetch-response-response">response</a><span>, in §3.4</span>
   <li><a href="#background-fetch-record-response-data">response data</a><span>, in §3.3</span>
   <li><a href="#backgroundfetchrecord-response-promise">response promise</a><span>, in §6.5</span>
   <li><a href="#dom-backgroundfetchrecord-responseready">responseReady</a><span>, in §6.5</span>
   <li>
    result
    <ul>
     <li><a href="#dom-backgroundfetchregistration-result">attribute for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#backgroundfetchregistration-result">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-result">dfn for background fetch</a><span>, in §3.2</span>
     <li><a href="#background-fetch-response-result">dfn for background fetch response</a><span>, in §3.4</span>
    </ul>
   <li>
    service worker registration
    <ul>
     <li><a href="#backgroundfetchmanager-service-worker-registration">dfn for BackgroundFetchManager</a><span>, in §6.3</span>
     <li><a href="#background-fetch-service-worker-registration">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li><a href="#single-byte-content-range">single byte content-range</a><span>, in §5</span>
   <li><a href="#background-fetch-stored-body-bytes-total">stored body bytes total</a><span>, in §3.2</span>
   <li><a href="#dom-backgroundfetchresult-success">"success"</a><span>, in §6.4</span>
   <li><a href="#temporarily-unavailable">temporarily unavailable</a><span>, in §3</span>
   <li>
    title
    <ul>
     <li><a href="#background-fetch-title">dfn for background fetch</a><span>, in §3.2</span>
     <li><a href="#dom-backgroundfetchuioptions-title">dict-member for BackgroundFetchUIOptions</a><span>, in §6.3</span>
    </ul>
   <li><a href="#backgroundfetchupdateuievent-ui-updated-flag">UI updated flag</a><span>, in §6.7</span>
   <li><a href="#update-background-fetch-instances">update background fetch instances</a><span>, in §4.3</span>
   <li><a href="#background-fetch-update-handling-queue">update handling queue</a><span>, in §3.2</span>
   <li><a href="#dom-backgroundfetchupdateuievent-updateui">updateUI()</a><span>, in §6.7.1</span>
   <li><a href="#dom-backgroundfetchupdateuievent-updateui">updateUI(options)</a><span>, in §6.7.1</span>
   <li>
    uploaded
    <ul>
     <li><a href="#dom-backgroundfetchregistration-uploaded">attribute for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#backgroundfetchregistration-uploaded">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-uploaded">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li><a href="#dom-backgroundfetchregistration-uploadtotal">uploadTotal</a><span>, in §6.4</span>
   <li>
    upload total
    <ul>
     <li><a href="#backgroundfetchregistration-upload-total">dfn for BackgroundFetchRegistration</a><span>, in §6.4</span>
     <li><a href="#background-fetch-upload-total">dfn for background fetch</a><span>, in §3.2</span>
    </ul>
   <li><a href="#validate-a-partial-response">validate a partial response</a><span>, in §4.6</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-dom-imageresource">
   <a href="https://www.w3.org/TR/appmanifest/#dom-imageresource">https://www.w3.org/TR/appmanifest/#dom-imageresource</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-imageresource">3.2. Background fetch</a>
    <li><a href="#ref-for-dom-imageresource①">3.2.1. Display</a>
    <li><a href="#ref-for-dom-imageresource②">6.3. BackgroundFetchManager</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event">
   <a href="https://dom.spec.whatwg.org/#event">https://dom.spec.whatwg.org/#event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event">6.4.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventtarget">
   <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventtarget">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-context-object">
   <a href="https://dom.spec.whatwg.org/#context-object">https://dom.spec.whatwg.org/#context-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-context-object">2. Realms</a>
    <li><a href="#ref-for-context-object①">3. Infrastructure</a>
    <li><a href="#ref-for-context-object②">6.2. Extensions to ServiceWorkerRegistration</a> <a href="#ref-for-context-object③">(2)</a>
    <li><a href="#ref-for-context-object④">6.3.1. fetch()</a> <a href="#ref-for-context-object⑤">(2)</a> <a href="#ref-for-context-object⑥">(3)</a> <a href="#ref-for-context-object⑦">(4)</a>
    <li><a href="#ref-for-context-object⑧">6.3.2. get()</a> <a href="#ref-for-context-object⑨">(2)</a>
    <li><a href="#ref-for-context-object①⓪">6.3.3. getIds()</a>
    <li><a href="#ref-for-context-object①①">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-context-object①②">(2)</a> <a href="#ref-for-context-object①③">(3)</a> <a href="#ref-for-context-object①④">(4)</a> <a href="#ref-for-context-object①⑤">(5)</a> <a href="#ref-for-context-object①⑥">(6)</a> <a href="#ref-for-context-object①⑦">(7)</a> <a href="#ref-for-context-object①⑧">(8)</a>
    <li><a href="#ref-for-context-object①⑨">6.4.2. abort()</a>
    <li><a href="#ref-for-context-object②⓪">6.4.4. matchAll()</a> <a href="#ref-for-context-object②①">(2)</a> <a href="#ref-for-context-object②②">(3)</a>
    <li><a href="#ref-for-context-object②③">6.5. BackgroundFetchRecord</a> <a href="#ref-for-context-object②④">(2)</a>
    <li><a href="#ref-for-context-object②⑤">6.7.1. updateUI()</a> <a href="#ref-for-context-object②⑥">(2)</a> <a href="#ref-for-context-object②⑦">(3)</a> <a href="#ref-for-context-object②⑧">(4)</a> <a href="#ref-for-context-object②⑨">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-fire">
   <a href="https://dom.spec.whatwg.org/#concept-event-fire">https://dom.spec.whatwg.org/#concept-event-fire</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-fire">4.3. Update background fetch instances</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-event-istrusted">
   <a href="https://dom.spec.whatwg.org/#dom-event-istrusted">https://dom.spec.whatwg.org/#dom-event-istrusted</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-event-istrusted">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-document-url">
   <a href="https://dom.spec.whatwg.org/#concept-document-url">https://dom.spec.whatwg.org/#concept-document-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-document-url">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-realm">
   <a href="https://tc39.github.io/ecma262/#realm">https://tc39.github.io/ecma262/#realm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-realm">4.5. Get a BackgroundFetchRegistration instance</a>
    <li><a href="#ref-for-realm①">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-headers">
   <a href="https://fetch.spec.whatwg.org/#headers">https://fetch.spec.whatwg.org/#headers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-headers">4.8. Create record objects</a> <a href="#ref-for-headers①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request">
   <a href="https://fetch.spec.whatwg.org/#request">https://fetch.spec.whatwg.org/#request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request">4.8. Create record objects</a> <a href="#ref-for-request①">(2)</a>
    <li><a href="#ref-for-request②">6.3.1. fetch()</a>
    <li><a href="#ref-for-request③">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-requestinfo">
   <a href="https://fetch.spec.whatwg.org/#requestinfo">https://fetch.spec.whatwg.org/#requestinfo</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-requestinfo">6.3. BackgroundFetchManager</a> <a href="#ref-for-requestinfo①">(2)</a>
    <li><a href="#ref-for-requestinfo②">6.3.1. fetch()</a>
    <li><a href="#ref-for-requestinfo③">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-requestinfo④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-response">
   <a href="https://fetch.spec.whatwg.org/#response">https://fetch.spec.whatwg.org/#response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-response">4.8. Create record objects</a> <a href="#ref-for-response①">(2)</a>
    <li><a href="#ref-for-response②">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-aborted-network-error">
   <a href="https://fetch.spec.whatwg.org/#concept-aborted-network-error">https://fetch.spec.whatwg.org/#concept-aborted-network-error</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-aborted-network-error">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-add-range-header">
   <a href="https://fetch.spec.whatwg.org/#concept-request-add-range-header">https://fetch.spec.whatwg.org/#concept-request-add-range-header</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-add-range-header">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-body">
   <a href="https://fetch.spec.whatwg.org/#concept-response-body">https://fetch.spec.whatwg.org/#concept-response-body</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-body">4.2. Complete a record</a> <a href="#ref-for-concept-response-body①">(2)</a>
    <li><a href="#ref-for-concept-response-body②">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-cancel-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream">https://fetch.spec.whatwg.org/#concept-cancel-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-cancel-readablestream">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-client">
   <a href="https://fetch.spec.whatwg.org/#concept-request-client">https://fetch.spec.whatwg.org/#concept-request-client</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-client">3.2.1. Display</a>
    <li><a href="#ref-for-concept-request-client①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-closed">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-closed">https://fetch.spec.whatwg.org/#concept-readablestream-closed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-closed">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-list-combine">
   <a href="https://fetch.spec.whatwg.org/#concept-header-list-combine">https://fetch.spec.whatwg.org/#concept-header-list-combine</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-list-combine">4.6. Validate a partial response</a> <a href="#ref-for-concept-header-list-combine①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-construct-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-construct-readablestream">https://fetch.spec.whatwg.org/#concept-construct-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-construct-readablestream">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-header-list-contains">
   <a href="https://fetch.spec.whatwg.org/#header-list-contains">https://fetch.spec.whatwg.org/#header-list-contains</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-header-list-contains">4.6. Validate a partial response</a>
    <li><a href="#ref-for-header-list-contains①">4.7. Extract content-range values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-credentials-mode">
   <a href="https://fetch.spec.whatwg.org/#concept-request-credentials-mode">https://fetch.spec.whatwg.org/#concept-request-credentials-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-credentials-mode">3.2.1. Display</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-list-delete">
   <a href="https://fetch.spec.whatwg.org/#concept-header-list-delete">https://fetch.spec.whatwg.org/#concept-header-list-delete</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-list-delete">4.8. Create record objects</a> <a href="#ref-for-concept-header-list-delete①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-destination">
   <a href="https://fetch.spec.whatwg.org/#concept-request-destination">https://fetch.spec.whatwg.org/#concept-request-destination</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-destination">3.2.1. Display</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-enqueue-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-enqueue-readablestream">https://fetch.spec.whatwg.org/#concept-enqueue-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-enqueue-readablestream">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-errored">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-errored">https://fetch.spec.whatwg.org/#concept-readablestream-errored</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-errored">4.2. Complete a record</a>
    <li><a href="#ref-for-concept-readablestream-errored①">4.8. Create record objects</a> <a href="#ref-for-concept-readablestream-errored②">(2)</a>
    <li><a href="#ref-for-concept-readablestream-errored③">6.3.1. fetch()</a> <a href="#ref-for-concept-readablestream-errored④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-fetch">https://fetch.spec.whatwg.org/#concept-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-fetch">3.2.1. Display</a>
    <li><a href="#ref-for-concept-fetch①">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header">
   <a href="https://fetch.spec.whatwg.org/#concept-header">https://fetch.spec.whatwg.org/#concept-header</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header">4.7. Extract content-range values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-header-list">
   <a href="https://fetch.spec.whatwg.org/#concept-response-header-list">https://fetch.spec.whatwg.org/#concept-response-header-list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-header-list">4.6. Validate a partial response</a> <a href="#ref-for-concept-response-header-list①">(2)</a> <a href="#ref-for-concept-response-header-list②">(3)</a>
    <li><a href="#ref-for-concept-response-header-list③">4.7. Extract content-range values</a> <a href="#ref-for-concept-response-header-list④">(2)</a>
    <li><a href="#ref-for-concept-response-header-list⑤">4.8. Create record objects</a> <a href="#ref-for-concept-response-header-list⑥">(2)</a> <a href="#ref-for-concept-response-header-list⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-response-headers">
   <a href="https://fetch.spec.whatwg.org/#response-headers">https://fetch.spec.whatwg.org/#response-headers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-response-headers">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request-keepalive-flag">
   <a href="https://fetch.spec.whatwg.org/#request-keepalive-flag">https://fetch.spec.whatwg.org/#request-keepalive-flag</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-keepalive-flag">3.2.1. Display</a>
    <li><a href="#ref-for-request-keepalive-flag①">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-method">
   <a href="https://fetch.spec.whatwg.org/#concept-request-method">https://fetch.spec.whatwg.org/#concept-request-method</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-method">3.2.1. Display</a> <a href="#ref-for-concept-request-method①">(2)</a>
    <li><a href="#ref-for-concept-request-method②">4.2. Complete a record</a> <a href="#ref-for-concept-request-method③">(2)</a> <a href="#ref-for-concept-request-method④">(3)</a> <a href="#ref-for-concept-request-method⑤">(4)</a>
    <li><a href="#ref-for-concept-request-method⑥">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-mode">
   <a href="https://fetch.spec.whatwg.org/#concept-request-mode">https://fetch.spec.whatwg.org/#concept-request-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-mode">3.2.1. Display</a>
    <li><a href="#ref-for-concept-request-mode①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-name">
   <a href="https://fetch.spec.whatwg.org/#concept-header-name">https://fetch.spec.whatwg.org/#concept-header-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-name">4.7. Extract content-range values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-network-error">
   <a href="https://fetch.spec.whatwg.org/#concept-network-error">https://fetch.spec.whatwg.org/#concept-network-error</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-network-error">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ok-status">
   <a href="https://fetch.spec.whatwg.org/#ok-status">https://fetch.spec.whatwg.org/#ok-status</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ok-status">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-process-request-body">
   <a href="https://fetch.spec.whatwg.org/#process-request-body">https://fetch.spec.whatwg.org/#process-request-body</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-process-request-body">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-process-response">
   <a href="https://fetch.spec.whatwg.org/#process-response">https://fetch.spec.whatwg.org/#process-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-process-response">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-readable">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-readable">https://fetch.spec.whatwg.org/#concept-readablestream-readable</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-readable">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-request">
   <a href="https://fetch.spec.whatwg.org/#concept-request-request">https://fetch.spec.whatwg.org/#concept-request-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-request">4.8. Create record objects</a> <a href="#ref-for-concept-request-request①">(2)</a>
    <li><a href="#ref-for-concept-request-request②">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-response">
   <a href="https://fetch.spec.whatwg.org/#concept-response-response">https://fetch.spec.whatwg.org/#concept-response-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-response">4.8. Create record objects</a> <a href="#ref-for-concept-response-response①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request-service-workers-mode">
   <a href="https://fetch.spec.whatwg.org/#request-service-workers-mode">https://fetch.spec.whatwg.org/#request-service-workers-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-service-workers-mode">3.2.1. Display</a>
    <li><a href="#ref-for-request-service-workers-mode①">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-status">
   <a href="https://fetch.spec.whatwg.org/#concept-response-status">https://fetch.spec.whatwg.org/#concept-response-status</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-status">4.2. Complete a record</a> <a href="#ref-for-concept-response-status①">(2)</a> <a href="#ref-for-concept-response-status②">(3)</a> <a href="#ref-for-concept-response-status③">(4)</a>
    <li><a href="#ref-for-concept-response-status④">4.6. Validate a partial response</a> <a href="#ref-for-concept-response-status⑤">(2)</a>
    <li><a href="#ref-for-concept-response-status⑥">7.1. Click</a> <a href="#ref-for-concept-response-status⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-stream">
   <a href="https://fetch.spec.whatwg.org/#concept-body-stream">https://fetch.spec.whatwg.org/#concept-body-stream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-stream">4.2. Complete a record</a>
    <li><a href="#ref-for-concept-body-stream①">4.8. Create record objects</a>
    <li><a href="#ref-for-concept-body-stream②">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-fetch-terminate">
   <a href="https://fetch.spec.whatwg.org/#concept-fetch-terminate">https://fetch.spec.whatwg.org/#concept-fetch-terminate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-fetch-terminate">4.2. Complete a record</a> <a href="#ref-for-concept-fetch-terminate①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-total-bytes">
   <a href="https://fetch.spec.whatwg.org/#concept-body-total-bytes">https://fetch.spec.whatwg.org/#concept-body-total-bytes</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-total-bytes">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-transmitted">
   <a href="https://fetch.spec.whatwg.org/#concept-body-transmitted">https://fetch.spec.whatwg.org/#concept-body-transmitted</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-transmitted">4.2. Complete a record</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-url">
   <a href="https://fetch.spec.whatwg.org/#concept-request-url">https://fetch.spec.whatwg.org/#concept-request-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-url">3.2.1. Display</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-value">
   <a href="https://fetch.spec.whatwg.org/#concept-header-value">https://fetch.spec.whatwg.org/#concept-header-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-value">4.7. Extract content-range values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-wait">
   <a href="https://fetch.spec.whatwg.org/#concept-body-wait">https://fetch.spec.whatwg.org/#concept-body-wait</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-wait">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventhandler">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventhandler">6.1. Extensions to ServiceWorkerGlobalScope</a> <a href="#ref-for-eventhandler①">(2)</a> <a href="#ref-for-eventhandler②">(3)</a> <a href="#ref-for-eventhandler③">(4)</a>
    <li><a href="#ref-for-eventhandler④">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-active-document">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">https://html.spec.whatwg.org/multipage/browsers.html#active-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-active-document">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-enqueue-the-following-steps">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps">https://html.spec.whatwg.org/multipage/infrastructure.html#enqueue-the-following-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enqueue-the-following-steps">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-enqueue-the-following-steps①">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-enqueue-the-following-steps②">6.3.1. fetch()</a>
    <li><a href="#ref-for-enqueue-the-following-steps③">6.3.2. get()</a>
    <li><a href="#ref-for-enqueue-the-following-steps④">6.4.2. abort()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-environment-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-environment-settings-object">3.2.1. Display</a>
    <li><a href="#ref-for-environment-settings-object①">4.3. Update background fetch instances</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handlers">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers">https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handlers">6.1.1. Events</a> <a href="#ref-for-event-handlers①">(2)</a>
    <li><a href="#ref-for-event-handlers②">6.4.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-event-type">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-event-type">6.1.1. Events</a> <a href="#ref-for-event-handler-event-type①">(2)</a>
    <li><a href="#ref-for-event-handler-event-type②">6.4.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-idl-attributes">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-idl-attributes">6.1.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-loop">3. Infrastructure</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-in-parallel">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-in-parallel">4.1. Perform a background fetch</a> <a href="#ref-for-in-parallel①">(2)</a>
    <li><a href="#ref-for-in-parallel②">4.8. Create record objects</a> <a href="#ref-for-in-parallel③">(2)</a>
    <li><a href="#ref-for-in-parallel④">6.3.1. fetch()</a> <a href="#ref-for-in-parallel⑤">(2)</a> <a href="#ref-for-in-parallel⑥">(3)</a>
    <li><a href="#ref-for-in-parallel⑦">6.3.2. get()</a>
    <li><a href="#ref-for-in-parallel⑧">6.3.3. getIds()</a>
    <li><a href="#ref-for-in-parallel⑨">6.4.2. abort()</a>
    <li><a href="#ref-for-in-parallel①⓪">6.4.4. matchAll()</a>
    <li><a href="#ref-for-in-parallel①①">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-networking-task-source">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source">https://html.spec.whatwg.org/multipage/webappapis.html#networking-task-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-networking-task-source">4.8. Create record objects</a> <a href="#ref-for-networking-task-source①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-settings-object-origin">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-settings-object-origin">4.3. Update background fetch instances</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-parallel-queue">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#parallel-queue">https://html.spec.whatwg.org/multipage/infrastructure.html#parallel-queue</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parallel-queue">3.1. Extensions to service worker registration</a>
    <li><a href="#ref-for-parallel-queue①">3.2. Background fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-queue-a-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-task">3. Infrastructure</a>
    <li><a href="#ref-for-queue-a-task①">4.8. Create record objects</a> <a href="#ref-for-queue-a-task②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-relevant-realm">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm">https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-relevant-realm">2. Realms</a>
    <li><a href="#ref-for-concept-relevant-realm①">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-concept-relevant-realm②">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-concept-relevant-realm③">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-concept-relevant-realm④">6.3.1. fetch()</a>
    <li><a href="#ref-for-concept-relevant-realm⑤">6.3.2. get()</a>
    <li><a href="#ref-for-concept-relevant-realm⑥">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-relevant-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relevant-settings-object">3. Infrastructure</a>
    <li><a href="#ref-for-relevant-settings-object①">4.8. Create record objects</a> <a href="#ref-for-relevant-settings-object②">(2)</a>
    <li><a href="#ref-for-relevant-settings-object③">6.3.1. fetch()</a> <a href="#ref-for-relevant-settings-object④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-event-loop">3. Infrastructure</a>
    <li><a href="#ref-for-responsible-event-loop①">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-responsible-event-loop②">4.8. Create record objects</a> <a href="#ref-for-responsible-event-loop③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-starting-a-new-parallel-queue">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#starting-a-new-parallel-queue">https://html.spec.whatwg.org/multipage/infrastructure.html#starting-a-new-parallel-queue</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-starting-a-new-parallel-queue">3.1. Extensions to service worker registration</a>
    <li><a href="#ref-for-starting-a-new-parallel-queue①">3.2. Background fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-task-source">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source">https://html.spec.whatwg.org/multipage/webappapis.html#task-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-task-source">3. Infrastructure</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-abort-when">
   <a href="https://infra.spec.whatwg.org/#abort-when">https://infra.spec.whatwg.org/#abort-when</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-abort-when">4.2. Complete a record</a>
    <li><a href="#ref-for-abort-when①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-append">
   <a href="https://infra.spec.whatwg.org/#list-append">https://infra.spec.whatwg.org/#list-append</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-append">4.8. Create record objects</a>
    <li><a href="#ref-for-list-append①">6.3.1. fetch()</a>
    <li><a href="#ref-for-list-append②">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-byte-sequence">
   <a href="https://infra.spec.whatwg.org/#byte-sequence">https://infra.spec.whatwg.org/#byte-sequence</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-byte-sequence">3.4. Background fetch response</a> <a href="#ref-for-byte-sequence①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-byte-case-insensitive">
   <a href="https://infra.spec.whatwg.org/#byte-case-insensitive">https://infra.spec.whatwg.org/#byte-case-insensitive</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-byte-case-insensitive">4.7. Extract content-range values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-iteration-continue">
   <a href="https://infra.spec.whatwg.org/#iteration-continue">https://infra.spec.whatwg.org/#iteration-continue</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-iteration-continue">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-empty">
   <a href="https://infra.spec.whatwg.org/#list-empty">https://infra.spec.whatwg.org/#list-empty</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-empty">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-exists">
   <a href="https://infra.spec.whatwg.org/#map-exists">https://infra.spec.whatwg.org/#map-exists</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-exists">4.5. Get a BackgroundFetchRegistration instance</a>
    <li><a href="#ref-for-map-exists①">4.9. Contains background fetch</a>
    <li><a href="#ref-for-map-exists②">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-iterate">
   <a href="https://infra.spec.whatwg.org/#list-iterate">https://infra.spec.whatwg.org/#list-iterate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-iterate">3.2. Background fetch</a>
    <li><a href="#ref-for-list-iterate①">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-list-iterate②">4.8. Create record objects</a>
    <li><a href="#ref-for-list-iterate③">6.3.1. fetch()</a> <a href="#ref-for-list-iterate④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-map-getting-the-keys">
   <a href="https://infra.spec.whatwg.org/#map-getting-the-keys">https://infra.spec.whatwg.org/#map-getting-the-keys</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-map-getting-the-keys">6.3.3. getIds()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-if-aborted">
   <a href="https://infra.spec.whatwg.org/#if-aborted">https://infra.spec.whatwg.org/#if-aborted</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-if-aborted">4.2. Complete a record</a>
    <li><a href="#ref-for-if-aborted①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-byte-sequence-length">
   <a href="https://infra.spec.whatwg.org/#byte-sequence-length">https://infra.spec.whatwg.org/#byte-sequence-length</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-byte-sequence-length">3.2. Background fetch</a>
    <li><a href="#ref-for-byte-sequence-length①">4.2. Complete a record</a> <a href="#ref-for-byte-sequence-length②">(2)</a>
    <li><a href="#ref-for-byte-sequence-length③">4.8. Create record objects</a> <a href="#ref-for-byte-sequence-length④">(2)</a> <a href="#ref-for-byte-sequence-length⑤">(3)</a> <a href="#ref-for-byte-sequence-length⑥">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list">
   <a href="https://infra.spec.whatwg.org/#list">https://infra.spec.whatwg.org/#list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list">3.2. Background fetch</a> <a href="#ref-for-list①">(2)</a>
    <li><a href="#ref-for-list②">4.8. Create record objects</a> <a href="#ref-for-list③">(2)</a>
    <li><a href="#ref-for-list④">6.3.1. fetch()</a> <a href="#ref-for-list⑤">(2)</a>
    <li><a href="#ref-for-list⑥">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ordered-map">
   <a href="https://infra.spec.whatwg.org/#ordered-map">https://infra.spec.whatwg.org/#ordered-map</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ordered-map">3.1. Extensions to service worker registration</a> <a href="#ref-for-ordered-map①">(2)</a>
    <li><a href="#ref-for-ordered-map②">4.9. Contains background fetch</a> <a href="#ref-for-ordered-map③">(2)</a>
    <li><a href="#ref-for-ordered-map④">6.3. BackgroundFetchManager</a> <a href="#ref-for-ordered-map⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-size">
   <a href="https://infra.spec.whatwg.org/#list-size">https://infra.spec.whatwg.org/#list-size</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-size">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-list-size①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-permissiondescriptor">
   <a href="https://w3c.github.io/permissions/#dictdef-permissiondescriptor">https://w3c.github.io/permissions/#dictdef-permissiondescriptor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-permissiondescriptor">3.2.1. Display</a>
    <li><a href="#ref-for-dictdef-permissiondescriptor①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissiondescriptor-name">
   <a href="https://w3c.github.io/permissions/#dom-permissiondescriptor-name">https://w3c.github.io/permissions/#dom-permissiondescriptor-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissiondescriptor-name">3.2.1. Display</a>
    <li><a href="#ref-for-dom-permissiondescriptor-name①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-new-information-about-the-users-intent">
   <a href="https://w3c.github.io/permissions/#new-information-about-the-users-intent">https://w3c.github.io/permissions/#new-information-about-the-users-intent</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-new-information-about-the-users-intent">3.2.1. Display</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-state">
   <a href="https://w3c.github.io/permissions/#permission-state">https://w3c.github.io/permissions/#permission-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-state">3.2.1. Display</a>
    <li><a href="#ref-for-permission-state①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-new-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise">https://www.w3.org/2001/tag/doc/promises-guide/#a-new-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-new-promise">4.8. Create record objects</a> <a href="#ref-for-a-new-promise①">(2)</a>
    <li><a href="#ref-for-a-new-promise②">6.3.1. fetch()</a>
    <li><a href="#ref-for-a-new-promise③">6.3.2. get()</a>
    <li><a href="#ref-for-a-new-promise④">6.3.3. getIds()</a>
    <li><a href="#ref-for-a-new-promise⑤">6.4.2. abort()</a>
    <li><a href="#ref-for-a-new-promise⑥">6.4.4. matchAll()</a>
    <li><a href="#ref-for-a-new-promise⑦">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-promise-rejected-with">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with">https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-promise-rejected-with">6.3.1. fetch()</a> <a href="#ref-for-a-promise-rejected-with①">(2)</a> <a href="#ref-for-a-promise-rejected-with②">(3)</a>
    <li><a href="#ref-for-a-promise-rejected-with③">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-reject-promise">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-reject-promise">4.8. Create record objects</a> <a href="#ref-for-reject-promise①">(2)</a>
    <li><a href="#ref-for-reject-promise②">6.3.1. fetch()</a> <a href="#ref-for-reject-promise③">(2)</a> <a href="#ref-for-reject-promise④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-cachequeryoptions">
   <a href="https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions">https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cachequeryoptions">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-dictdef-cachequeryoptions①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extendableevent">
   <a href="https://w3c.github.io/ServiceWorker/#extendableevent">https://w3c.github.io/ServiceWorker/#extendableevent</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendableevent">6.6. BackgroundFetchEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-extendableeventinit">
   <a href="https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit">https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-extendableeventinit">6.6. BackgroundFetchEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serviceworker">
   <a href="https://w3c.github.io/ServiceWorker/#serviceworker">https://w3c.github.io/ServiceWorker/#serviceworker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworker">6.1.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serviceworkerglobalscope">
   <a href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope">https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkerglobalscope">6.1. Extensions to ServiceWorkerGlobalScope</a> <a href="#ref-for-serviceworkerglobalscope①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-serviceworkerregistration">
   <a href="https://w3c.github.io/ServiceWorker/#serviceworkerregistration">https://w3c.github.io/ServiceWorker/#serviceworkerregistration</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkerregistration">6.2. Extensions to ServiceWorkerRegistration</a> <a href="#ref-for-serviceworkerregistration①">(2)</a> <a href="#ref-for-serviceworkerregistration②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-extendableevent-active">
   <a href="https://w3c.github.io/ServiceWorker/#extendableevent-active">https://w3c.github.io/ServiceWorker/#extendableevent-active</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendableevent-active">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-extendableevent-active①">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-active-worker">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-active-worker">https://w3c.github.io/ServiceWorker/#dfn-active-worker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-active-worker">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fire-functional-event">
   <a href="https://w3c.github.io/ServiceWorker/#fire-functional-event">https://w3c.github.io/ServiceWorker/#fire-functional-event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fire-functional-event">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-fire-functional-event①">4.4. Fire a background fetch click event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-match-service-worker-registration">
   <a href="https://w3c.github.io/ServiceWorker/#match-service-worker-registration">https://w3c.github.io/ServiceWorker/#match-service-worker-registration</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-match-service-worker-registration">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request-matches-cached-item">
   <a href="https://w3c.github.io/ServiceWorker/#request-matches-cached-item">https://w3c.github.io/ServiceWorker/#request-matches-cached-item</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-matches-cached-item">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-scope-url">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-scope-url">https://w3c.github.io/ServiceWorker/#dfn-scope-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-scope-url">3.2.1. Display</a>
    <li><a href="#ref-for-dfn-scope-url①">4.3. Update background fetch instances</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-service-worker">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-service-worker">https://w3c.github.io/ServiceWorker/#dfn-service-worker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker">1. Introduction</a> <a href="#ref-for-dfn-service-worker①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-service-worker-registration">
   <a href="https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration">https://w3c.github.io/ServiceWorker/#dfn-service-worker-registration</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-registration">3.1. Extensions to service worker registration</a>
    <li><a href="#ref-for-dfn-service-worker-registration①">3.2. Background fetch</a>
    <li><a href="#ref-for-dfn-service-worker-registration②">6.2. Extensions to ServiceWorkerRegistration</a>
    <li><a href="#ref-for-dfn-service-worker-registration③">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-dfn-service-worker-registration④">8. Privacy and bandwidth usage</a> <a href="#ref-for-dfn-service-worker-registration⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-extendableevent-waituntil">
   <a href="https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil">https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-extendableevent-waituntil">1. Introduction</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-origin">
   <a href="https://url.spec.whatwg.org/#concept-url-origin">https://url.spec.whatwg.org/#concept-url-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-origin">3.2.1. Display</a>
    <li><a href="#ref-for-concept-url-origin①">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-concept-url-origin②">8. Privacy and bandwidth usage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-current-top-level-browsing-context">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-top-level-browsing-context">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-top-level-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-current-top-level-browsing-context">7.1. Click</a> <a href="#ref-for-dfn-current-top-level-browsing-context①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-extension-command">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extension-command">7. Automation</a>
    <li><a href="#ref-for-dfn-extension-command①">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-extension-command-uri-template">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command-uri-template">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command-uri-template</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extension-command-uri-template">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-no-longer-open">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-no-longer-open">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-no-longer-open</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-no-longer-open">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-no-such-window">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-no-such-window">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-no-such-window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-no-such-window">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-remote-end-steps">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-remote-end-steps">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-remote-end-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-remote-end-steps">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-url-variables">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-url-variables">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-url-variables</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-url-variables">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-errors">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-errors">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-errors</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-errors">7.1. Click</a> <a href="#ref-for-dfn-errors①">(2)</a> <a href="#ref-for-dfn-errors②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-error-code">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-error-code">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-success">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-success">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-success</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-success">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-aborterror">
   <a href="https://heycam.github.io/webidl/#aborterror">https://heycam.github.io/webidl/#aborterror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-aborterror">4.8. Create record objects</a> <a href="#ref-for-aborterror①">(2)</a>
    <li><a href="#ref-for-aborterror②">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-ArrayBuffer">
   <a href="https://heycam.github.io/webidl/#idl-ArrayBuffer">https://heycam.github.io/webidl/#idl-ArrayBuffer</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-ArrayBuffer">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMException">
   <a href="https://heycam.github.io/webidl/#idl-DOMException">https://heycam.github.io/webidl/#idl-DOMException</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMException">4.8. Create record objects</a> <a href="#ref-for-idl-DOMException①">(2)</a>
    <li><a href="#ref-for-idl-DOMException②">6.3.1. fetch()</a> <a href="#ref-for-idl-DOMException③">(2)</a> <a href="#ref-for-idl-DOMException④">(3)</a>
    <li><a href="#ref-for-idl-DOMException⑤">6.4.4. matchAll()</a>
    <li><a href="#ref-for-idl-DOMException⑥">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">6.3. BackgroundFetchManager</a> <a href="#ref-for-idl-DOMString①">(2)</a> <a href="#ref-for-idl-DOMString②">(3)</a> <a href="#ref-for-idl-DOMString③">(4)</a>
    <li><a href="#ref-for-idl-DOMString④">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-idl-DOMString⑤">6.6. BackgroundFetchEvent</a>
    <li><a href="#ref-for-idl-DOMString⑥">6.7. BackgroundFetchUpdateUIEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-Exposed①">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-Exposed②">6.5. BackgroundFetchRecord</a>
    <li><a href="#ref-for-Exposed③">6.6. BackgroundFetchEvent</a>
    <li><a href="#ref-for-Exposed④">6.7. BackgroundFetchUpdateUIEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalidstateerror">
   <a href="https://heycam.github.io/webidl/#invalidstateerror">https://heycam.github.io/webidl/#invalidstateerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalidstateerror">6.4.4. matchAll()</a>
    <li><a href="#ref-for-invalidstateerror①">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-notallowederror">
   <a href="https://heycam.github.io/webidl/#notallowederror">https://heycam.github.io/webidl/#notallowederror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-notallowederror">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-promise">
   <a href="https://heycam.github.io/webidl/#idl-promise">https://heycam.github.io/webidl/#idl-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-promise">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-quotaexceedederror">
   <a href="https://heycam.github.io/webidl/#quotaexceedederror">https://heycam.github.io/webidl/#quotaexceedederror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-quotaexceedederror">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-exceptiondef-typeerror">
   <a href="https://heycam.github.io/webidl/#exceptiondef-typeerror">https://heycam.github.io/webidl/#exceptiondef-typeerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exceptiondef-typeerror">4.8. Create record objects</a> <a href="#ref-for-exceptiondef-typeerror①">(2)</a>
    <li><a href="#ref-for-exceptiondef-typeerror②">6.3.1. fetch()</a> <a href="#ref-for-exceptiondef-typeerror③">(2)</a> <a href="#ref-for-exceptiondef-typeerror④">(3)</a> <a href="#ref-for-exceptiondef-typeerror⑤">(4)</a> <a href="#ref-for-exceptiondef-typeerror⑥">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-Uint8Array">
   <a href="https://heycam.github.io/webidl/#idl-Uint8Array">https://heycam.github.io/webidl/#idl-Uint8Array</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-Uint8Array">4.8. Create record objects</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-idl-boolean①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-unsigned-long-long">
   <a href="https://heycam.github.io/webidl/#idl-unsigned-long-long">https://heycam.github.io/webidl/#idl-unsigned-long-long</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-unsigned-long-long">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-idl-unsigned-long-long①">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-idl-unsigned-long-long②">(2)</a> <a href="#ref-for-idl-unsigned-long-long③">(3)</a> <a href="#ref-for-idl-unsigned-long-long④">(4)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[appmanifest]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-imageresource" style="color:initial">ImageResource</span>
    </ul>
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-event" style="color:initial">Event</span>
     <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span>
     <li><span class="dfn-paneled" id="term-for-context-object" style="color:initial">context object</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-fire" style="color:initial">fire an event</span>
     <li><span class="dfn-paneled" id="term-for-dom-event-istrusted" style="color:initial">isTrusted</span>
     <li><span class="dfn-paneled" id="term-for-concept-document-url" style="color:initial">url</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ECMASCRIPT]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-realm" style="color:initial">realm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[FETCH]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-headers" style="color:initial">Headers</span>
     <li><span class="dfn-paneled" id="term-for-request" style="color:initial">Request</span>
     <li><span class="dfn-paneled" id="term-for-requestinfo" style="color:initial">RequestInfo</span>
     <li><span class="dfn-paneled" id="term-for-response" style="color:initial">Response</span>
     <li><span class="dfn-paneled" id="term-for-concept-aborted-network-error" style="color:initial">aborted network error</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-add-range-header" style="color:initial">add a range header</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-body" style="color:initial">body <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-concept-cancel-readablestream" style="color:initial">cancel</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-client" style="color:initial">client</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-closed" style="color:initial">closed</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-list-combine" style="color:initial">combine</span>
     <li><span class="dfn-paneled" id="term-for-concept-construct-readablestream" style="color:initial">construct a readablestream object</span>
     <li><span class="dfn-paneled" id="term-for-header-list-contains" style="color:initial">contains</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-credentials-mode" style="color:initial">credentials mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-list-delete" style="color:initial">delete</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-destination" style="color:initial">destination</span>
     <li><span class="dfn-paneled" id="term-for-concept-enqueue-readablestream" style="color:initial">enqueue</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-errored" style="color:initial">errored</span>
     <li><span class="dfn-paneled" id="term-for-concept-fetch" style="color:initial">fetch</span>
     <li><span class="dfn-paneled" id="term-for-concept-header" style="color:initial">header</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-header-list" style="color:initial">header list <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-response-headers" style="color:initial">headers <small>(for Response)</small></span>
     <li><span class="dfn-paneled" id="term-for-request-keepalive-flag" style="color:initial">keepalive flag</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-method" style="color:initial">method</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-mode" style="color:initial">mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-name" style="color:initial">name</span>
     <li><span class="dfn-paneled" id="term-for-concept-network-error" style="color:initial">network error</span>
     <li><span class="dfn-paneled" id="term-for-ok-status" style="color:initial">ok status</span>
     <li><span class="dfn-paneled" id="term-for-process-request-body" style="color:initial">process request body</span>
     <li><span class="dfn-paneled" id="term-for-process-response" style="color:initial">process response</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-readable" style="color:initial">readable</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-request" style="color:initial">request <small>(for Request)</small></span>
     <li><span class="dfn-paneled" id="term-for-concept-response-response" style="color:initial">response <small>(for Response)</small></span>
     <li><span class="dfn-paneled" id="term-for-request-service-workers-mode" style="color:initial">service-workers mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-status" style="color:initial">status</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-stream" style="color:initial">stream</span>
     <li><span class="dfn-paneled" id="term-for-concept-fetch-terminate" style="color:initial">terminated</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-total-bytes" style="color:initial">total bytes</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-transmitted" style="color:initial">transmitted bytes</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-url" style="color:initial">url</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-value" style="color:initial">value</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-wait" style="color:initial">wait</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-eventhandler" style="color:initial">EventHandler</span>
     <li><span class="dfn-paneled" id="term-for-active-document" style="color:initial">active document</span>
     <li><span class="dfn-paneled" id="term-for-enqueue-the-following-steps" style="color:initial">enqueue the following steps</span>
     <li><span class="dfn-paneled" id="term-for-environment-settings-object" style="color:initial">environment settings object</span>
     <li><span class="dfn-paneled" id="term-for-event-handlers" style="color:initial">event handler</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-event-type" style="color:initial">event handler event type</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-idl-attributes" style="color:initial">event handler idl attribute</span>
     <li><span class="dfn-paneled" id="term-for-event-loop" style="color:initial">event loop</span>
     <li><span class="dfn-paneled" id="term-for-in-parallel" style="color:initial">in parallel</span>
     <li><span class="dfn-paneled" id="term-for-networking-task-source" style="color:initial">networking task source</span>
     <li><span class="dfn-paneled" id="term-for-concept-settings-object-origin" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-parallel-queue" style="color:initial">parallel queue</span>
     <li><span class="dfn-paneled" id="term-for-queue-a-task" style="color:initial">queue a task</span>
     <li><span class="dfn-paneled" id="term-for-concept-relevant-realm" style="color:initial">relevant realm</span>
     <li><span class="dfn-paneled" id="term-for-relevant-settings-object" style="color:initial">relevant settings object</span>
     <li><span class="dfn-paneled" id="term-for-responsible-event-loop" style="color:initial">responsible event loop</span>
     <li><span class="dfn-paneled" id="term-for-starting-a-new-parallel-queue" style="color:initial">starting a new parallel queue</span>
     <li><span class="dfn-paneled" id="term-for-task-source" style="color:initial">task source</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-abort-when" style="color:initial">abort when</span>
     <li><span class="dfn-paneled" id="term-for-list-append" style="color:initial">append</span>
     <li><span class="dfn-paneled" id="term-for-byte-sequence" style="color:initial">byte sequence</span>
     <li><span class="dfn-paneled" id="term-for-byte-case-insensitive" style="color:initial">byte-case-insensitive</span>
     <li><span class="dfn-paneled" id="term-for-iteration-continue" style="color:initial">continue</span>
     <li><span class="dfn-paneled" id="term-for-list-empty" style="color:initial">empty</span>
     <li><span class="dfn-paneled" id="term-for-map-exists" style="color:initial">exist</span>
     <li><span class="dfn-paneled" id="term-for-list-iterate" style="color:initial">for each</span>
     <li><span class="dfn-paneled" id="term-for-map-getting-the-keys" style="color:initial">getting the keys</span>
     <li><span class="dfn-paneled" id="term-for-if-aborted" style="color:initial">if aborted</span>
     <li><span class="dfn-paneled" id="term-for-byte-sequence-length" style="color:initial">length</span>
     <li><span class="dfn-paneled" id="term-for-list" style="color:initial">list</span>
     <li><span class="dfn-paneled" id="term-for-ordered-map" style="color:initial">map</span>
     <li><span class="dfn-paneled" id="term-for-list-size" style="color:initial">size</span>
    </ul>
   <li>
    <a data-link-type="biblio">[permissions]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dictdef-permissiondescriptor" style="color:initial">PermissionDescriptor</span>
     <li><span class="dfn-paneled" id="term-for-dom-permissiondescriptor-name" style="color:initial">name</span>
     <li><span class="dfn-paneled" id="term-for-new-information-about-the-users-intent" style="color:initial">new information about the user's intent</span>
     <li><span class="dfn-paneled" id="term-for-permission-state" style="color:initial">permission state</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-a-new-promise" style="color:initial">a new promise</span>
     <li><span class="dfn-paneled" id="term-for-a-promise-rejected-with" style="color:initial">a promise rejected with</span>
     <li><span class="dfn-paneled" id="term-for-reject-promise" style="color:initial">reject</span>
    </ul>
   <li>
    <a data-link-type="biblio">[service-workers-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dictdef-cachequeryoptions" style="color:initial">CacheQueryOptions</span>
     <li><span class="dfn-paneled" id="term-for-extendableevent" style="color:initial">ExtendableEvent</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-extendableeventinit" style="color:initial">ExtendableEventInit</span>
     <li><span class="dfn-paneled" id="term-for-serviceworker" style="color:initial">ServiceWorker</span>
     <li><span class="dfn-paneled" id="term-for-serviceworkerglobalscope" style="color:initial">ServiceWorkerGlobalScope</span>
     <li><span class="dfn-paneled" id="term-for-serviceworkerregistration" style="color:initial">ServiceWorkerRegistration</span>
     <li><span class="dfn-paneled" id="term-for-extendableevent-active" style="color:initial">active</span>
     <li><span class="dfn-paneled" id="term-for-dfn-active-worker" style="color:initial">active worker</span>
     <li><span class="dfn-paneled" id="term-for-fire-functional-event" style="color:initial">fire a functional event</span>
     <li><span class="dfn-paneled" id="term-for-match-service-worker-registration" style="color:initial">match service worker registration</span>
     <li><span class="dfn-paneled" id="term-for-request-matches-cached-item" style="color:initial">request matches cached item</span>
     <li><span class="dfn-paneled" id="term-for-dfn-scope-url" style="color:initial">scope url</span>
     <li><span class="dfn-paneled" id="term-for-dfn-service-worker" style="color:initial">service worker</span>
     <li><span class="dfn-paneled" id="term-for-dfn-service-worker-registration" style="color:initial">service worker registration</span>
     <li><span class="dfn-paneled" id="term-for-dom-extendableevent-waituntil" style="color:initial">waitUntil(f)</span>
    </ul>
   <li>
    <a data-link-type="biblio">[URL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-concept-url-origin" style="color:initial">origin</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebDriver]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dfn-current-top-level-browsing-context" style="color:initial">current top-level browsing context</span>
     <li><span class="dfn-paneled" id="term-for-dfn-extension-command" style="color:initial">extension command</span>
     <li><span class="dfn-paneled" id="term-for-dfn-extension-command-uri-template" style="color:initial">extension command uri template</span>
     <li><span class="dfn-paneled" id="term-for-dfn-no-longer-open" style="color:initial">no longer open</span>
     <li><span class="dfn-paneled" id="term-for-dfn-no-such-window" style="color:initial">no such window</span>
     <li><span class="dfn-paneled" id="term-for-dfn-remote-end-steps" style="color:initial">remote end steps</span>
     <li><span class="dfn-paneled" id="term-for-dfn-url-variables" style="color:initial">url variable</span>
     <li><span class="dfn-paneled" id="term-for-dfn-errors" style="color:initial">webdriver error</span>
     <li><span class="dfn-paneled" id="term-for-dfn-error-code" style="color:initial">webdriver error code</span>
     <li><span class="dfn-paneled" id="term-for-dfn-success" style="color:initial">webdriver success</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-aborterror" style="color:initial">AbortError</span>
     <li><span class="dfn-paneled" id="term-for-idl-ArrayBuffer" style="color:initial">ArrayBuffer</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMException" style="color:initial">DOMException</span>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-invalidstateerror" style="color:initial">InvalidStateError</span>
     <li><span class="dfn-paneled" id="term-for-notallowederror" style="color:initial">NotAllowedError</span>
     <li><span class="dfn-paneled" id="term-for-idl-promise" style="color:initial">Promise</span>
     <li><span class="dfn-paneled" id="term-for-quotaexceedederror" style="color:initial">QuotaExceededError</span>
     <li><span class="dfn-paneled" id="term-for-exceptiondef-typeerror" style="color:initial">TypeError</span>
     <li><span class="dfn-paneled" id="term-for-idl-Uint8Array" style="color:initial">Uint8Array</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
     <li><span class="dfn-paneled" id="term-for-idl-unsigned-long-long" style="color:initial">unsigned long long</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-appmanifest">[APPMANIFEST]
   <dd>Marcos Caceres; et al. <a href="https://www.w3.org/TR/appmanifest/">Web App Manifest</a>. 31 May 2019. WD. URL: <a href="https://www.w3.org/TR/appmanifest/">https://www.w3.org/TR/appmanifest/</a>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-ecmascript">[ECMASCRIPT]
   <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a>
   <dt id="biblio-fetch">[FETCH]
   <dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-permissions">[PERMISSIONS]
   <dd>Mounir Lamouri; Marcos Caceres; Jeffrey Yasskin. <a href="https://www.w3.org/TR/permissions/">Permissions</a>. 25 September 2017. WD. URL: <a href="https://www.w3.org/TR/permissions/">https://www.w3.org/TR/permissions/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd>Domenic Denicola. <a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 9 November 2018. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-service-workers-1">[SERVICE-WORKERS-1]
   <dd>Alex Russell; et al. <a href="https://www.w3.org/TR/service-workers-1/">Service Workers 1</a>. 2 November 2017. WD. URL: <a href="https://www.w3.org/TR/service-workers-1/">https://www.w3.org/TR/service-workers-1/</a>
   <dt id="biblio-url">[URL]
   <dd>Anne van Kesteren. <a href="https://url.spec.whatwg.org/">URL Standard</a>. Living Standard. URL: <a href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</a>
   <dt id="biblio-webdriver">[WebDriver]
   <dd>Simon Stewart; David Burns. <a href="https://www.w3.org/TR/webdriver1/">WebDriver</a>. 5 June 2018. REC. URL: <a href="https://www.w3.org/TR/webdriver1/">https://www.w3.org/TR/webdriver1/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope" id="ref-for-serviceworkerglobalscope①①"><c- g>ServiceWorkerGlobalScope</c-></a> {
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-serviceworkerglobalscope-onbackgroundfetchsuccess"><code><c- g>onbackgroundfetchsuccess</c-></code></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①①"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-serviceworkerglobalscope-onbackgroundfetchfail"><code><c- g>onbackgroundfetchfail</c-></code></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②①"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-serviceworkerglobalscope-onbackgroundfetchabort"><code><c- g>onbackgroundfetchabort</c-></code></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③①"><c- n>EventHandler</c-></a> <a data-type="EventHandler" href="#dom-serviceworkerglobalscope-onbackgroundfetchclick"><code><c- g>onbackgroundfetchclick</c-></code></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://w3c.github.io/ServiceWorker/#serviceworkerregistration" id="ref-for-serviceworkerregistration①①"><c- g>ServiceWorkerRegistration</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#backgroundfetchmanager" id="ref-for-backgroundfetchmanager②①"><c- n>BackgroundFetchManager</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchManager" href="#dom-serviceworkerregistration-backgroundfetch" id="ref-for-dom-serviceworkerregistration-backgroundfetch①"><c- g>backgroundFetch</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a href="#backgroundfetchmanager"><code><c- g>BackgroundFetchManager</c-></code></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration③①"><c- n>BackgroundFetchRegistration</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchmanager-fetch" id="ref-for-dom-backgroundfetchmanager-fetch②"><c- g>fetch</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑦"><c- b>DOMString</c-></a> <a href="#dom-backgroundfetchmanager-fetch-id-requests-options-id"><code><c- g>id</c-></code></a>, (<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑤"><c- n>RequestInfo</c-></a> <c- b>or</c-> <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo①①"><c- n>RequestInfo</c-></a>>) <a href="#dom-backgroundfetchmanager-fetch-id-requests-options-requests"><code><c- g>requests</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetchoptions" id="ref-for-dictdef-backgroundfetchoptions①"><c- n>BackgroundFetchOptions</c-></a> <a href="#dom-backgroundfetchmanager-fetch-id-requests-options-options"><code><c- g>options</c-></code></a> = {});
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration④①"><c- n>BackgroundFetchRegistration</c-></a>?> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchmanager-get" id="ref-for-dom-backgroundfetchmanager-get②"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①"><c- b>DOMString</c-></a> <a href="#dom-backgroundfetchmanager-get-id-id"><code><c- g>id</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②①"><c- b>DOMString</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchmanager-getids" id="ref-for-dom-backgroundfetchmanager-getids②"><c- g>getIds</c-></a>();
};

<c- b>dictionary</c-> <a href="#dictdef-backgroundfetchuioptions"><code><c- g>BackgroundFetchUIOptions</c-></code></a> {
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/appmanifest/#dom-imageresource" id="ref-for-dom-imageresource②①"><c- n>ImageResource</c-></a>> <a data-type="sequence<ImageResource> " href="#dom-backgroundfetchuioptions-icons"><code><c- g>icons</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString③①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-backgroundfetchuioptions-title"><code><c- g>title</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-backgroundfetchoptions"><code><c- g>BackgroundFetchOptions</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetchuioptions" id="ref-for-dictdef-backgroundfetchuioptions②"><c- n>BackgroundFetchUIOptions</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long⑤"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a data-default="0" data-type="unsigned long long " href="#dom-backgroundfetchoptions-downloadtotal"><code><c- g>downloadTotal</c-></code></a> = 0;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a href="#backgroundfetchregistration"><code><c- g>BackgroundFetchRegistration</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString④①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#dom-backgroundfetchregistration-id" id="ref-for-dom-backgroundfetchregistration-id①"><c- g>id</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long①①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-uploadtotal" id="ref-for-dom-backgroundfetchregistration-uploadtotal①"><c- g>uploadTotal</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long②①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-uploaded" id="ref-for-dom-backgroundfetchregistration-uploaded①"><c- g>uploaded</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long③①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-downloadtotal" id="ref-for-dom-backgroundfetchregistration-downloadtotal①"><c- g>downloadTotal</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-unsigned-long-long" id="ref-for-idl-unsigned-long-long④①"><c- b>unsigned</c-> <c- b>long</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long long" href="#dom-backgroundfetchregistration-downloaded" id="ref-for-dom-backgroundfetchregistration-downloaded①"><c- g>downloaded</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#enumdef-backgroundfetchresult" id="ref-for-enumdef-backgroundfetchresult①①"><c- n>BackgroundFetchResult</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchResult" href="#dom-backgroundfetchregistration-result" id="ref-for-dom-backgroundfetchregistration-result①"><c- g>result</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#enumdef-backgroundfetchfailurereason" id="ref-for-enumdef-backgroundfetchfailurereason②①"><c- n>BackgroundFetchFailureReason</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchFailureReason" href="#dom-backgroundfetchregistration-failurereason" id="ref-for-dom-backgroundfetchregistration-failurereason①"><c- g>failureReason</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#dom-backgroundfetchregistration-recordsavailable" id="ref-for-dom-backgroundfetchregistration-recordsavailable①"><c- g>recordsAvailable</c-></a>;

  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-backgroundfetchregistration-onprogress" id="ref-for-dom-backgroundfetchregistration-onprogress①"><c- g>onprogress</c-></a>;

  <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchregistration-abort" id="ref-for-dom-backgroundfetchregistration-abort②①"><c- g>abort</c-></a>();
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord①①"><c- n>BackgroundFetchRecord</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchregistration-match" id="ref-for-dom-backgroundfetchregistration-match②"><c- g>match</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo③①"><c- n>RequestInfo</c-></a> <a href="#dom-backgroundfetchregistration-match-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions" id="ref-for-dictdef-cachequeryoptions②"><c- n>CacheQueryOptions</c-></a> <a href="#dom-backgroundfetchregistration-match-request-options-options"><code><c- g>options</c-></code></a> = {});
  <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#backgroundfetchrecord" id="ref-for-backgroundfetchrecord②①"><c- n>BackgroundFetchRecord</c-></a>>> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchregistration-matchall" id="ref-for-dom-backgroundfetchregistration-matchall④"><c- g>matchAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo④①"><c- n>RequestInfo</c-></a> <a href="#dom-backgroundfetchregistration-matchall-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions" id="ref-for-dictdef-cachequeryoptions①①"><c- n>CacheQueryOptions</c-></a> <a href="#dom-backgroundfetchregistration-matchall-request-options-options"><code><c- g>options</c-></code></a> = {});
};

<c- b>enum</c-> <a href="#enumdef-backgroundfetchresult"><code><c- g>BackgroundFetchResult</c-></code></a> { <a href="#dom-backgroundfetchresult"><code><c- s>""</c-></code></a>, <a href="#dom-backgroundfetchresult-success"><code><c- s>"success"</c-></code></a>, <a href="#dom-backgroundfetchresult-failure"><code><c- s>"failure"</c-></code></a> };

<c- b>enum</c-> <a href="#enumdef-backgroundfetchfailurereason"><code><c- g>BackgroundFetchFailureReason</c-></code></a> {
  // The background fetch has not completed yet, or was successful.
  <a href="#dom-backgroundfetchfailurereason"><code><c- s>""</c-></code></a>,
  // The operation was aborted by the user, or abort() was called.
  <a href="#dom-backgroundfetchfailurereason-aborted"><code><c- s>"aborted"</c-></code></a>,
  // A response had a not-ok-status.
  <a href="#dom-backgroundfetchfailurereason-bad-status"><code><c- s>"bad-status"</c-></code></a>,
  // A fetch failed for other reasons, e.g. CORS, MIX, an invalid partial response,
  // or a general network failure for a fetch that cannot be retried.
  <a href="#dom-backgroundfetchfailurereason-fetch-error"><code><c- s>"fetch-error"</c-></code></a>,
  // Storage quota was reached during the operation.
  <a href="#dom-backgroundfetchfailurereason-quota-exceeded"><code><c- s>"quota-exceeded"</c-></code></a>,
  // The provided downloadTotal was exceeded.
  <a href="#dom-backgroundfetchfailurereason-download-total-exceeded"><code><c- s>"download-total-exceeded"</c-></code></a>
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a href="#backgroundfetchrecord"><code><c- g>BackgroundFetchRecord</c-></code></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request③①"><c- n>Request</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Request" href="#dom-backgroundfetchrecord-request" id="ref-for-dom-backgroundfetchrecord-request①①"><c- g>request</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response②①"><c- n>Response</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Promise<Response>" href="#dom-backgroundfetchrecord-responseready" id="ref-for-dom-backgroundfetchrecord-responseready④①"><c- g>responseReady</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a href="#backgroundfetchevent"><code><c- g>BackgroundFetchEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#extendableevent" id="ref-for-extendableevent①"><c- n>ExtendableEvent</c-></a> {
  <a href="#dom-backgroundfetchevent-backgroundfetchevent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑤①"><c- b>DOMString</c-></a> <a href="#dom-backgroundfetchevent-backgroundfetchevent-type-init-type"><code><c- g>type</c-></code></a>, <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetcheventinit" id="ref-for-dictdef-backgroundfetcheventinit②"><c- n>BackgroundFetchEventInit</c-></a> <a href="#dom-backgroundfetchevent-backgroundfetchevent-type-init-init"><code><c- g>init</c-></code></a>);
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration⑨①"><c- n>BackgroundFetchRegistration</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="BackgroundFetchRegistration" href="#dom-backgroundfetchevent-registration" id="ref-for-dom-backgroundfetchevent-registration②①"><c- g>registration</c-></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-backgroundfetcheventinit"><code><c- g>BackgroundFetchEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://w3c.github.io/ServiceWorker/#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit①"><c- n>ExtendableEventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#backgroundfetchregistration" id="ref-for-backgroundfetchregistration①⓪①"><c- n>BackgroundFetchRegistration</c-></a> <a data-type="BackgroundFetchRegistration " href="#dom-backgroundfetcheventinit-registration"><code><c- g>registration</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a href="#backgroundfetchupdateuievent"><code><c- g>BackgroundFetchUpdateUIEvent</c-></code></a> : <a class="n" data-link-type="idl-name" href="#backgroundfetchevent" id="ref-for-backgroundfetchevent⑥①"><c- n>BackgroundFetchEvent</c-></a> {
  <a href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent"><code><c- g>constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑥①"><c- b>DOMString</c-></a> <a href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent-type-init-type"><code><c- g>type</c-></code></a>, <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetcheventinit" id="ref-for-dictdef-backgroundfetcheventinit①①"><c- n>BackgroundFetchEventInit</c-></a> <a href="#dom-backgroundfetchupdateuievent-backgroundfetchupdateuievent-type-init-init"><code><c- g>init</c-></code></a>);
  <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#dom-backgroundfetchupdateuievent-updateui" id="ref-for-dom-backgroundfetchupdateuievent-updateui②"><c- g>updateUI</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-backgroundfetchuioptions" id="ref-for-dictdef-backgroundfetchuioptions①①"><c- n>BackgroundFetchUIOptions</c-></a> <a href="#dom-backgroundfetchupdateuievent-updateui-options-options"><code><c- g>options</c-></code></a> = {});
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> <a href="https://github.com/w3c/manifest/pull/710">manifest/pull/710</a>.<a href="#issue-20b63876"> ↵ </a></div>
   <div class="issue"> <a href="https://github.com/w3c/ServiceWorker/pull/1348">ServiceWorker/1348</a>.<a href="#issue-b420dc4f"> ↵ </a></div>
   <div class="issue"> The remainder of this step uses fetch "callbacks" which currently queue tasks. This isn’t desirable or possible here, so let’s pretend that tasks aren’t queued. (<a href="https://github.com/whatwg/fetch/issues/536#issuecomment-330184276">issue</a>)<a href="#issue-775cdb79"> ↵ </a></div>
   <div class="issue"> I need to debounce this similar to how mouse move events debounce.<a href="#issue-20ad71fa"> ↵ </a></div>
   <div class="issue"> Parsing as an integer <a href="https://github.com/whatwg/infra/issues/189">infra/189</a>.<a href="#issue-cddfe468"> ↵ </a></div>
   <div class="issue"> <a href="https://github.com/w3c/ServiceWorker/pull/1348">ServiceWorker/1348</a>.<a href="#issue-b420dc4f①"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="temporarily-unavailable">
   <b><a href="#temporarily-unavailable">#temporarily-unavailable</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-temporarily-unavailable">4.2. Complete a record</a> <a href="#ref-for-temporarily-unavailable①">(2)</a> <a href="#ref-for-temporarily-unavailable②">(3)</a> <a href="#ref-for-temporarily-unavailable③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-task-source">
   <b><a href="#background-fetch-task-source">#background-fetch-task-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-task-source">3. Infrastructure</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="queue-a-bgfetch-task">
   <b><a href="#queue-a-bgfetch-task">#queue-a-bgfetch-task</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-bgfetch-task">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-queue-a-bgfetch-task①">6.3.1. fetch()</a>
    <li><a href="#ref-for-queue-a-bgfetch-task②">6.3.2. get()</a>
    <li><a href="#ref-for-queue-a-bgfetch-task③">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-active-background-fetches">
   <b><a href="#service-worker-registration-active-background-fetches">#service-worker-registration-active-background-fetches</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches①">6.3.1. fetch()</a>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches②">6.3.2. get()</a>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches③">6.3.3. getIds()</a>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches④">6.4.2. abort()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-active-background-fetches-edit-queue">
   <b><a href="#service-worker-registration-active-background-fetches-edit-queue">#service-worker-registration-active-background-fetches-edit-queue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches-edit-queue">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches-edit-queue①">6.3.1. fetch()</a>
    <li><a href="#ref-for-service-worker-registration-active-background-fetches-edit-queue②">6.4.2. abort()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch">
   <b><a href="#background-fetch">#background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch">3.1. Extensions to service worker registration</a>
    <li><a href="#ref-for-background-fetch①">3.2. Background fetch</a> <a href="#ref-for-background-fetch②">(2)</a>
    <li><a href="#ref-for-background-fetch③">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch④">4.1. Perform a background fetch</a> <a href="#ref-for-background-fetch⑤">(2)</a>
    <li><a href="#ref-for-background-fetch⑥">4.2. Complete a record</a>
    <li><a href="#ref-for-background-fetch⑦">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch⑧">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-background-fetch⑨">4.5. Get a BackgroundFetchRegistration instance</a> <a href="#ref-for-background-fetch①⓪">(2)</a> <a href="#ref-for-background-fetch①①">(3)</a>
    <li><a href="#ref-for-background-fetch①②">4.9. Contains background fetch</a> <a href="#ref-for-background-fetch①③">(2)</a>
    <li><a href="#ref-for-background-fetch①④">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-background-fetch①⑤">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch①⑥">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-background-fetch①⑦">6.6. BackgroundFetchEvent</a>
    <li><a href="#ref-for-background-fetch①⑧">7.1. Click</a> <a href="#ref-for-background-fetch①⑨">(2)</a>
    <li><a href="#ref-for-background-fetch②⓪">8. Privacy and bandwidth usage</a> <a href="#ref-for-background-fetch②①">(2)</a> <a href="#ref-for-background-fetch②②">(3)</a> <a href="#ref-for-background-fetch②③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-id">
   <b><a href="#background-fetch-id">#background-fetch-id</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-id">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-id①">4.9. Contains background fetch</a>
    <li><a href="#ref-for-background-fetch-id②">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-id③">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-background-fetch-id④">6.4.2. abort()</a>
    <li><a href="#ref-for-background-fetch-id⑤">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-records">
   <b><a href="#background-fetch-records">#background-fetch-records</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-records">3.2. Background fetch</a>
    <li><a href="#ref-for-background-fetch-records①">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-records②">4.1. Perform a background fetch</a> <a href="#ref-for-background-fetch-records③">(2)</a>
    <li><a href="#ref-for-background-fetch-records④">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-records⑤">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-title">
   <b><a href="#background-fetch-title">#background-fetch-title</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-title">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-title①">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-title②">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-download-total">
   <b><a href="#background-fetch-download-total">#background-fetch-download-total</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-download-total">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-download-total①">4.2. Complete a record</a>
    <li><a href="#ref-for-background-fetch-download-total②">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-download-total③">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-upload-total">
   <b><a href="#background-fetch-upload-total">#background-fetch-upload-total</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-upload-total">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-upload-total①">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-upload-total②">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-uploaded">
   <b><a href="#background-fetch-uploaded">#background-fetch-uploaded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-uploaded">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-uploaded①">4.2. Complete a record</a>
    <li><a href="#ref-for-background-fetch-uploaded②">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-uploaded③">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-result">
   <b><a href="#background-fetch-result">#background-fetch-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-result">3.2.1. Display</a> <a href="#ref-for-background-fetch-result①">(2)</a> <a href="#ref-for-background-fetch-result②">(3)</a>
    <li><a href="#ref-for-background-fetch-result③">4.1. Perform a background fetch</a> <a href="#ref-for-background-fetch-result④">(2)</a>
    <li><a href="#ref-for-background-fetch-result⑤">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-result⑥">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-failure-reason">
   <b><a href="#background-fetch-failure-reason">#background-fetch-failure-reason</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-failure-reason">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-failure-reason①">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-failure-reason②">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-records-available-flag">
   <b><a href="#background-fetch-records-available-flag">#background-fetch-records-available-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-records-available-flag">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-records-available-flag①">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-records-available-flag②">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-icons">
   <b><a href="#background-fetch-icons">#background-fetch-icons</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-icons">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-icons①">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-icons②">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-service-worker-registration">
   <b><a href="#background-fetch-service-worker-registration">#background-fetch-service-worker-registration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-service-worker-registration">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-service-worker-registration①">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-service-worker-registration②">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-service-worker-registration③">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-background-fetch-service-worker-registration④">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-service-worker-registration⑤">6.4.2. abort()</a>
    <li><a href="#ref-for-background-fetch-service-worker-registration⑥">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-update-handling-queue">
   <b><a href="#background-fetch-update-handling-queue">#background-fetch-update-handling-queue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-update-handling-queue">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-update-handling-queue①">6.3.2. get()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-paused-flag">
   <b><a href="#background-fetch-paused-flag">#background-fetch-paused-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-paused-flag">3.2.1. Display</a> <a href="#ref-for-background-fetch-paused-flag①">(2)</a> <a href="#ref-for-background-fetch-paused-flag②">(3)</a> <a href="#ref-for-background-fetch-paused-flag③">(4)</a> <a href="#ref-for-background-fetch-paused-flag④">(5)</a> <a href="#ref-for-background-fetch-paused-flag⑤">(6)</a>
    <li><a href="#ref-for-background-fetch-paused-flag⑥">4.2. Complete a record</a> <a href="#ref-for-background-fetch-paused-flag⑦">(2)</a> <a href="#ref-for-background-fetch-paused-flag⑧">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-abort-all-flag">
   <b><a href="#background-fetch-abort-all-flag">#background-fetch-abort-all-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-abort-all-flag">3.2.1. Display</a> <a href="#ref-for-background-fetch-abort-all-flag①">(2)</a>
    <li><a href="#ref-for-background-fetch-abort-all-flag②">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-abort-all-flag③">4.2. Complete a record</a> <a href="#ref-for-background-fetch-abort-all-flag④">(2)</a>
    <li><a href="#ref-for-background-fetch-abort-all-flag⑤">6.4.2. abort()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-stored-body-bytes-total">
   <b><a href="#background-fetch-stored-body-bytes-total">#background-fetch-stored-body-bytes-total</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-stored-body-bytes-total">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-stored-body-bytes-total①">4.2. Complete a record</a>
    <li><a href="#ref-for-background-fetch-stored-body-bytes-total②">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-background-fetch-stored-body-bytes-total③">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-display">
   <b><a href="#background-fetch-display">#background-fetch-display</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-display">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-display①">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-display②">7.1. Click</a>
    <li><a href="#ref-for-background-fetch-display③">8. Privacy and bandwidth usage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-record">
   <b><a href="#background-fetch-record">#background-fetch-record</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-record">3.2. Background fetch</a>
    <li><a href="#ref-for-background-fetch-record①">4.2. Complete a record</a> <a href="#ref-for-background-fetch-record②">(2)</a> <a href="#ref-for-background-fetch-record③">(3)</a>
    <li><a href="#ref-for-background-fetch-record④">4.8. Create record objects</a> <a href="#ref-for-background-fetch-record⑤">(2)</a>
    <li><a href="#ref-for-background-fetch-record⑥">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-record-request">
   <b><a href="#background-fetch-record-request">#background-fetch-record-request</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-record-request">3.2.1. Display</a>
    <li><a href="#ref-for-background-fetch-record-request①">4.2. Complete a record</a>
    <li><a href="#ref-for-background-fetch-record-request②">4.8. Create record objects</a>
    <li><a href="#ref-for-background-fetch-record-request③">6.3.1. fetch()</a>
    <li><a href="#ref-for-background-fetch-record-request④">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-record-response-data">
   <b><a href="#background-fetch-record-response-data">#background-fetch-record-response-data</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-record-response-data">3.2. Background fetch</a>
    <li><a href="#ref-for-background-fetch-record-response-data①">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-record-response-data②">4.2. Complete a record</a> <a href="#ref-for-background-fetch-record-response-data③">(2)</a>
    <li><a href="#ref-for-background-fetch-record-response-data④">4.8. Create record objects</a>
    <li><a href="#ref-for-background-fetch-record-response-data⑤">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-response">
   <b><a href="#background-fetch-response">#background-fetch-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-response">3.3. Background fetch record</a> <a href="#ref-for-background-fetch-response①">(2)</a>
    <li><a href="#ref-for-background-fetch-response②">4.2. Complete a record</a> <a href="#ref-for-background-fetch-response③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-response-response">
   <b><a href="#background-fetch-response-response">#background-fetch-response-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-response-response">3.4. Background fetch response</a>
    <li><a href="#ref-for-background-fetch-response-response①">4.2. Complete a record</a> <a href="#ref-for-background-fetch-response-response②">(2)</a>
    <li><a href="#ref-for-background-fetch-response-response③">4.8. Create record objects</a> <a href="#ref-for-background-fetch-response-response④">(2)</a>
    <li><a href="#ref-for-background-fetch-response-response⑤">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-response-bytes">
   <b><a href="#background-fetch-response-bytes">#background-fetch-response-bytes</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-response-bytes">3.2. Background fetch</a>
    <li><a href="#ref-for-background-fetch-response-bytes①">4.2. Complete a record</a> <a href="#ref-for-background-fetch-response-bytes②">(2)</a> <a href="#ref-for-background-fetch-response-bytes③">(3)</a>
    <li><a href="#ref-for-background-fetch-response-bytes④">4.8. Create record objects</a> <a href="#ref-for-background-fetch-response-bytes⑤">(2)</a> <a href="#ref-for-background-fetch-response-bytes⑥">(3)</a> <a href="#ref-for-background-fetch-response-bytes⑦">(4)</a> <a href="#ref-for-background-fetch-response-bytes⑧">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-response-result">
   <b><a href="#background-fetch-response-result">#background-fetch-response-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-response-result">3.4. Background fetch response</a>
    <li><a href="#ref-for-background-fetch-response-result①">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-background-fetch-response-result②">4.2. Complete a record</a> <a href="#ref-for-background-fetch-response-result③">(2)</a> <a href="#ref-for-background-fetch-response-result④">(3)</a> <a href="#ref-for-background-fetch-response-result⑤">(4)</a> <a href="#ref-for-background-fetch-response-result⑥">(5)</a> <a href="#ref-for-background-fetch-response-result⑦">(6)</a> <a href="#ref-for-background-fetch-response-result⑧">(7)</a> <a href="#ref-for-background-fetch-response-result⑨">(8)</a> <a href="#ref-for-background-fetch-response-result①⓪">(9)</a> <a href="#ref-for-background-fetch-response-result①①">(10)</a> <a href="#ref-for-background-fetch-response-result①②">(11)</a> <a href="#ref-for-background-fetch-response-result①③">(12)</a>
    <li><a href="#ref-for-background-fetch-response-result①④">4.8. Create record objects</a> <a href="#ref-for-background-fetch-response-result①⑤">(2)</a> <a href="#ref-for-background-fetch-response-result①⑥">(3)</a> <a href="#ref-for-background-fetch-response-result①⑦">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-response-exposed">
   <b><a href="#background-fetch-response-exposed">#background-fetch-response-exposed</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-response-exposed">4.8. Create record objects</a> <a href="#ref-for-background-fetch-response-exposed①">(2)</a> <a href="#ref-for-background-fetch-response-exposed②">(3)</a> <a href="#ref-for-background-fetch-response-exposed③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="perform-a-background-fetch">
   <b><a href="#perform-a-background-fetch">#perform-a-background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-perform-a-background-fetch">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-perform-a-background-fetch①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="complete-a-record">
   <b><a href="#complete-a-record">#complete-a-record</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-complete-a-record">4.1. Perform a background fetch</a> <a href="#ref-for-complete-a-record①">(2)</a>
    <li><a href="#ref-for-complete-a-record②">4.2. Complete a record</a> <a href="#ref-for-complete-a-record③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="update-background-fetch-instances">
   <b><a href="#update-background-fetch-instances">#update-background-fetch-instances</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-update-background-fetch-instances">4.1. Perform a background fetch</a> <a href="#ref-for-update-background-fetch-instances①">(2)</a>
    <li><a href="#ref-for-update-background-fetch-instances②">4.2. Complete a record</a> <a href="#ref-for-update-background-fetch-instances③">(2)</a> <a href="#ref-for-update-background-fetch-instances④">(3)</a>
    <li><a href="#ref-for-update-background-fetch-instances⑤">4.3. Update background fetch instances</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fire-a-background-fetch-click-event">
   <b><a href="#fire-a-background-fetch-click-event">#fire-a-background-fetch-click-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fire-a-background-fetch-click-event">3.2.1. Display</a>
    <li><a href="#ref-for-fire-a-background-fetch-click-event①">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-fire-a-background-fetch-click-event②">7.1. Click</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="get-a-backgroundfetchregistration-instance">
   <b><a href="#get-a-backgroundfetchregistration-instance">#get-a-backgroundfetchregistration-instance</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-get-a-backgroundfetchregistration-instance">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-get-a-backgroundfetchregistration-instance①">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-get-a-backgroundfetchregistration-instance②">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-get-a-backgroundfetchregistration-instance③">4.5. Get a BackgroundFetchRegistration instance</a>
    <li><a href="#ref-for-get-a-backgroundfetchregistration-instance④">6.3.1. fetch()</a>
    <li><a href="#ref-for-get-a-backgroundfetchregistration-instance⑤">6.3.2. get()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="validate-a-partial-response">
   <b><a href="#validate-a-partial-response">#validate-a-partial-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-validate-a-partial-response">4.2. Complete a record</a>
    <li><a href="#ref-for-validate-a-partial-response①">4.6. Validate a partial response</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extract-content-range-values">
   <b><a href="#extract-content-range-values">#extract-content-range-values</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extract-content-range-values">4.2. Complete a record</a>
    <li><a href="#ref-for-extract-content-range-values①">4.6. Validate a partial response</a> <a href="#ref-for-extract-content-range-values②">(2)</a>
    <li><a href="#ref-for-extract-content-range-values③">4.7. Extract content-range values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-record-objects">
   <b><a href="#create-record-objects">#create-record-objects</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-record-objects">4.2. Complete a record</a>
    <li><a href="#ref-for-create-record-objects①">4.8. Create record objects</a>
    <li><a href="#ref-for-create-record-objects②">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="contains-background-fetch">
   <b><a href="#contains-background-fetch">#contains-background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-contains-background-fetch">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-contains-background-fetch①">4.9. Contains background fetch</a> <a href="#ref-for-contains-background-fetch②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="does-not-contain-background-fetch">
   <b><a href="#does-not-contain-background-fetch">#does-not-contain-background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-does-not-contain-background-fetch">6.4.2. abort()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="single-byte-content-range">
   <b><a href="#single-byte-content-range">#single-byte-content-range</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-single-byte-content-range">4.7. Extract content-range values</a> <a href="#ref-for-single-byte-content-range①">(2)</a> <a href="#ref-for-single-byte-content-range②">(3)</a> <a href="#ref-for-single-byte-content-range③">(4)</a> <a href="#ref-for-single-byte-content-range④">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceworkerglobalscope-onbackgroundfetchsuccess">
   <b><a href="#dom-serviceworkerglobalscope-onbackgroundfetchsuccess">#dom-serviceworkerglobalscope-onbackgroundfetchsuccess</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerglobalscope-onbackgroundfetchsuccess">6.1.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceworkerglobalscope-onbackgroundfetchfail">
   <b><a href="#dom-serviceworkerglobalscope-onbackgroundfetchfail">#dom-serviceworkerglobalscope-onbackgroundfetchfail</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerglobalscope-onbackgroundfetchfail">6.1.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceworkerglobalscope-onbackgroundfetchabort">
   <b><a href="#dom-serviceworkerglobalscope-onbackgroundfetchabort">#dom-serviceworkerglobalscope-onbackgroundfetchabort</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerglobalscope-onbackgroundfetchabort">6.1.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceworkerglobalscope-onbackgroundfetchclick">
   <b><a href="#dom-serviceworkerglobalscope-onbackgroundfetchclick">#dom-serviceworkerglobalscope-onbackgroundfetchclick</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerglobalscope-onbackgroundfetchclick">6.1.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkerregistration-background-fetch-manager">
   <b><a href="#serviceworkerregistration-background-fetch-manager">#serviceworkerregistration-background-fetch-manager</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkerregistration-background-fetch-manager">6.2. Extensions to ServiceWorkerRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-serviceworkerregistration-backgroundfetch">
   <b><a href="#dom-serviceworkerregistration-backgroundfetch">#dom-serviceworkerregistration-backgroundfetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-serviceworkerregistration-backgroundfetch">6.2. Extensions to ServiceWorkerRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchmanager">
   <b><a href="#backgroundfetchmanager">#backgroundfetchmanager</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchmanager">4.5. Get a BackgroundFetchRegistration instance</a> <a href="#ref-for-backgroundfetchmanager①">(2)</a>
    <li><a href="#ref-for-backgroundfetchmanager②">6.2. Extensions to ServiceWorkerRegistration</a> <a href="#ref-for-backgroundfetchmanager③">(2)</a> <a href="#ref-for-backgroundfetchmanager④">(3)</a>
    <li><a href="#ref-for-backgroundfetchmanager⑤">6.3. BackgroundFetchManager</a> <a href="#ref-for-backgroundfetchmanager⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-backgroundfetchuioptions">
   <b><a href="#dictdef-backgroundfetchuioptions">#dictdef-backgroundfetchuioptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-backgroundfetchuioptions">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-dictdef-backgroundfetchuioptions①">6.7. BackgroundFetchUpdateUIEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchuioptions-icons">
   <b><a href="#dom-backgroundfetchuioptions-icons">#dom-backgroundfetchuioptions-icons</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchuioptions-icons">6.7.1. updateUI()</a> <a href="#ref-for-dom-backgroundfetchuioptions-icons①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchuioptions-title">
   <b><a href="#dom-backgroundfetchuioptions-title">#dom-backgroundfetchuioptions-title</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchuioptions-title">6.7.1. updateUI()</a> <a href="#ref-for-dom-backgroundfetchuioptions-title①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-backgroundfetchoptions">
   <b><a href="#dictdef-backgroundfetchoptions">#dictdef-backgroundfetchoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-backgroundfetchoptions">6.3. BackgroundFetchManager</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchmanager-backgroundfetchregistration-instances">
   <b><a href="#backgroundfetchmanager-backgroundfetchregistration-instances">#backgroundfetchmanager-backgroundfetchregistration-instances</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchmanager-backgroundfetchregistration-instances">4.5. Get a BackgroundFetchRegistration instance</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchmanager-service-worker-registration">
   <b><a href="#backgroundfetchmanager-service-worker-registration">#backgroundfetchmanager-service-worker-registration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchmanager-service-worker-registration">6.2. Extensions to ServiceWorkerRegistration</a>
    <li><a href="#ref-for-backgroundfetchmanager-service-worker-registration①">6.3.1. fetch()</a>
    <li><a href="#ref-for-backgroundfetchmanager-service-worker-registration②">6.3.2. get()</a>
    <li><a href="#ref-for-backgroundfetchmanager-service-worker-registration③">6.3.3. getIds()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchmanager-fetch">
   <b><a href="#dom-backgroundfetchmanager-fetch">#dom-backgroundfetchmanager-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchmanager-fetch">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-dom-backgroundfetchmanager-fetch①">6.3.1. fetch()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchmanager-get">
   <b><a href="#dom-backgroundfetchmanager-get">#dom-backgroundfetchmanager-get</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchmanager-get">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-dom-backgroundfetchmanager-get①">6.3.2. get()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchmanager-getids">
   <b><a href="#dom-backgroundfetchmanager-getids">#dom-backgroundfetchmanager-getids</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchmanager-getids">6.3. BackgroundFetchManager</a>
    <li><a href="#ref-for-dom-backgroundfetchmanager-getids①">6.3.3. getIds()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration">
   <b><a href="#backgroundfetchregistration">#backgroundfetchregistration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-backgroundfetchregistration①">4.5. Get a BackgroundFetchRegistration instance</a> <a href="#ref-for-backgroundfetchregistration②">(2)</a>
    <li><a href="#ref-for-backgroundfetchregistration③">6.3. BackgroundFetchManager</a> <a href="#ref-for-backgroundfetchregistration④">(2)</a> <a href="#ref-for-backgroundfetchregistration⑤">(3)</a>
    <li><a href="#ref-for-backgroundfetchregistration⑥">6.3.2. get()</a>
    <li><a href="#ref-for-backgroundfetchregistration⑦">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-backgroundfetchregistration⑧">(2)</a>
    <li><a href="#ref-for-backgroundfetchregistration⑨">6.6. BackgroundFetchEvent</a> <a href="#ref-for-backgroundfetchregistration①⓪">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-backgroundfetchresult">
   <b><a href="#enumdef-backgroundfetchresult">#enumdef-backgroundfetchresult</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-backgroundfetchresult">3.2. Background fetch</a>
    <li><a href="#ref-for-enumdef-backgroundfetchresult①">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-enumdef-backgroundfetchresult②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-backgroundfetchfailurereason">
   <b><a href="#enumdef-backgroundfetchfailurereason">#enumdef-backgroundfetchfailurereason</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-backgroundfetchfailurereason">3.2. Background fetch</a>
    <li><a href="#ref-for-enumdef-backgroundfetchfailurereason①">3.4. Background fetch response</a>
    <li><a href="#ref-for-enumdef-backgroundfetchfailurereason②">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-enumdef-backgroundfetchfailurereason③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-background-fetch">
   <b><a href="#backgroundfetchregistration-background-fetch">#backgroundfetchregistration-background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-background-fetch">4.3. Update background fetch instances</a>
    <li><a href="#ref-for-backgroundfetchregistration-background-fetch①">4.5. Get a BackgroundFetchRegistration instance</a>
    <li><a href="#ref-for-backgroundfetchregistration-background-fetch②">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-backgroundfetchregistration-background-fetch③">(2)</a> <a href="#ref-for-backgroundfetchregistration-background-fetch④">(3)</a> <a href="#ref-for-backgroundfetchregistration-background-fetch⑤">(4)</a> <a href="#ref-for-backgroundfetchregistration-background-fetch⑥">(5)</a> <a href="#ref-for-backgroundfetchregistration-background-fetch⑦">(6)</a> <a href="#ref-for-backgroundfetchregistration-background-fetch⑧">(7)</a> <a href="#ref-for-backgroundfetchregistration-background-fetch⑨">(8)</a>
    <li><a href="#ref-for-backgroundfetchregistration-background-fetch①⓪">6.4.2. abort()</a>
    <li><a href="#ref-for-backgroundfetchregistration-background-fetch①①">6.4.4. matchAll()</a>
    <li><a href="#ref-for-backgroundfetchregistration-background-fetch①②">6.6. BackgroundFetchEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-downloaded">
   <b><a href="#backgroundfetchregistration-downloaded">#backgroundfetchregistration-downloaded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-downloaded">4.3. Update background fetch instances</a> <a href="#ref-for-backgroundfetchregistration-downloaded①">(2)</a>
    <li><a href="#ref-for-backgroundfetchregistration-downloaded②">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-uploaded">
   <b><a href="#backgroundfetchregistration-uploaded">#backgroundfetchregistration-uploaded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-uploaded">4.3. Update background fetch instances</a> <a href="#ref-for-backgroundfetchregistration-uploaded①">(2)</a>
    <li><a href="#ref-for-backgroundfetchregistration-uploaded②">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-result">
   <b><a href="#backgroundfetchregistration-result">#backgroundfetchregistration-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-result">4.3. Update background fetch instances</a> <a href="#ref-for-backgroundfetchregistration-result①">(2)</a> <a href="#ref-for-backgroundfetchregistration-result②">(3)</a>
    <li><a href="#ref-for-backgroundfetchregistration-result③">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-failure-reason">
   <b><a href="#backgroundfetchregistration-failure-reason">#backgroundfetchregistration-failure-reason</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-failure-reason">4.3. Update background fetch instances</a> <a href="#ref-for-backgroundfetchregistration-failure-reason①">(2)</a>
    <li><a href="#ref-for-backgroundfetchregistration-failure-reason②">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-id">
   <b><a href="#backgroundfetchregistration-id">#backgroundfetchregistration-id</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-id">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-upload-total">
   <b><a href="#backgroundfetchregistration-upload-total">#backgroundfetchregistration-upload-total</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-upload-total">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-download-total">
   <b><a href="#backgroundfetchregistration-download-total">#backgroundfetchregistration-download-total</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-download-total">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchregistration-records-available-flag">
   <b><a href="#backgroundfetchregistration-records-available-flag">#backgroundfetchregistration-records-available-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchregistration-records-available-flag">4.3. Update background fetch instances</a> <a href="#ref-for-backgroundfetchregistration-records-available-flag①">(2)</a>
    <li><a href="#ref-for-backgroundfetchregistration-records-available-flag②">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-backgroundfetchregistration-records-available-flag③">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-id">
   <b><a href="#dom-backgroundfetchregistration-id">#dom-backgroundfetchregistration-id</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-id">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-uploadtotal">
   <b><a href="#dom-backgroundfetchregistration-uploadtotal">#dom-backgroundfetchregistration-uploadtotal</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-uploadtotal">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-downloadtotal">
   <b><a href="#dom-backgroundfetchregistration-downloadtotal">#dom-backgroundfetchregistration-downloadtotal</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-downloadtotal">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-uploaded">
   <b><a href="#dom-backgroundfetchregistration-uploaded">#dom-backgroundfetchregistration-uploaded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-uploaded">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-downloaded">
   <b><a href="#dom-backgroundfetchregistration-downloaded">#dom-backgroundfetchregistration-downloaded</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-downloaded">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-result">
   <b><a href="#dom-backgroundfetchregistration-result">#dom-backgroundfetchregistration-result</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-result">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-failurereason">
   <b><a href="#dom-backgroundfetchregistration-failurereason">#dom-backgroundfetchregistration-failurereason</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-failurereason">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-recordsavailable">
   <b><a href="#dom-backgroundfetchregistration-recordsavailable">#dom-backgroundfetchregistration-recordsavailable</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-recordsavailable">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-onprogress">
   <b><a href="#dom-backgroundfetchregistration-onprogress">#dom-backgroundfetchregistration-onprogress</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-onprogress">6.4. BackgroundFetchRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="eventdef-backgroundfetchregistration-progress">
   <b><a href="#eventdef-backgroundfetchregistration-progress">#eventdef-backgroundfetchregistration-progress</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-backgroundfetchregistration-progress">6.3.2. get()</a>
    <li><a href="#ref-for-eventdef-backgroundfetchregistration-progress①">6.4.1. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-abort">
   <b><a href="#dom-backgroundfetchregistration-abort">#dom-backgroundfetchregistration-abort</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-abort">4.1. Perform a background fetch</a> <a href="#ref-for-dom-backgroundfetchregistration-abort①">(2)</a>
    <li><a href="#ref-for-dom-backgroundfetchregistration-abort②">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-dom-backgroundfetchregistration-abort③">6.4.2. abort()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-match">
   <b><a href="#dom-backgroundfetchregistration-match">#dom-backgroundfetchregistration-match</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-match">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-dom-backgroundfetchregistration-match①">6.4.3. match()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchregistration-matchall">
   <b><a href="#dom-backgroundfetchregistration-matchall">#dom-backgroundfetchregistration-matchall</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchregistration-matchall">6.4. BackgroundFetchRegistration</a>
    <li><a href="#ref-for-dom-backgroundfetchregistration-matchall①">6.4.3. match()</a> <a href="#ref-for-dom-backgroundfetchregistration-matchall②">(2)</a>
    <li><a href="#ref-for-dom-backgroundfetchregistration-matchall③">6.4.4. matchAll()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchrecord">
   <b><a href="#backgroundfetchrecord">#backgroundfetchrecord</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchrecord">4.8. Create record objects</a>
    <li><a href="#ref-for-backgroundfetchrecord①">6.4. BackgroundFetchRegistration</a> <a href="#ref-for-backgroundfetchrecord②">(2)</a>
    <li><a href="#ref-for-backgroundfetchrecord③">6.5. BackgroundFetchRecord</a> <a href="#ref-for-backgroundfetchrecord④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchrecord-request">
   <b><a href="#backgroundfetchrecord-request">#backgroundfetchrecord-request</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchrecord-request">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchrecord-response-promise">
   <b><a href="#backgroundfetchrecord-response-promise">#backgroundfetchrecord-response-promise</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchrecord-response-promise">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchrecord-request">
   <b><a href="#dom-backgroundfetchrecord-request">#dom-backgroundfetchrecord-request</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchrecord-request">4.8. Create record objects</a>
    <li><a href="#ref-for-dom-backgroundfetchrecord-request①">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchrecord-responseready">
   <b><a href="#dom-backgroundfetchrecord-responseready">#dom-backgroundfetchrecord-responseready</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchrecord-responseready">4.8. Create record objects</a> <a href="#ref-for-dom-backgroundfetchrecord-responseready①">(2)</a> <a href="#ref-for-dom-backgroundfetchrecord-responseready②">(3)</a> <a href="#ref-for-dom-backgroundfetchrecord-responseready③">(4)</a>
    <li><a href="#ref-for-dom-backgroundfetchrecord-responseready④">6.5. BackgroundFetchRecord</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchevent">
   <b><a href="#backgroundfetchevent">#backgroundfetchevent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchevent">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-backgroundfetchevent①">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-backgroundfetchevent②">6.1.1. Events</a> <a href="#ref-for-backgroundfetchevent③">(2)</a>
    <li><a href="#ref-for-backgroundfetchevent④">6.6. BackgroundFetchEvent</a> <a href="#ref-for-backgroundfetchevent⑤">(2)</a>
    <li><a href="#ref-for-backgroundfetchevent⑥">6.7. BackgroundFetchUpdateUIEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-backgroundfetcheventinit">
   <b><a href="#dictdef-backgroundfetcheventinit">#dictdef-backgroundfetcheventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-backgroundfetcheventinit">6.6. BackgroundFetchEvent</a>
    <li><a href="#ref-for-dictdef-backgroundfetcheventinit①">6.7. BackgroundFetchUpdateUIEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchevent-background-fetch">
   <b><a href="#backgroundfetchevent-background-fetch">#backgroundfetchevent-background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchevent-background-fetch">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchevent-registration">
   <b><a href="#dom-backgroundfetchevent-registration">#dom-backgroundfetchevent-registration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchevent-registration">4.1. Perform a background fetch</a>
    <li><a href="#ref-for-dom-backgroundfetchevent-registration①">4.4. Fire a background fetch click event</a>
    <li><a href="#ref-for-dom-backgroundfetchevent-registration②">6.6. BackgroundFetchEvent</a> <a href="#ref-for-dom-backgroundfetchevent-registration③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchupdateuievent">
   <b><a href="#backgroundfetchupdateuievent">#backgroundfetchupdateuievent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchupdateuievent">4.1. Perform a background fetch</a> <a href="#ref-for-backgroundfetchupdateuievent①">(2)</a>
    <li><a href="#ref-for-backgroundfetchupdateuievent②">6.1.1. Events</a> <a href="#ref-for-backgroundfetchupdateuievent③">(2)</a>
    <li><a href="#ref-for-backgroundfetchupdateuievent④">6.7. BackgroundFetchUpdateUIEvent</a> <a href="#ref-for-backgroundfetchupdateuievent⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="backgroundfetchupdateuievent-ui-updated-flag">
   <b><a href="#backgroundfetchupdateuievent-ui-updated-flag">#backgroundfetchupdateuievent-ui-updated-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-backgroundfetchupdateuievent-ui-updated-flag">6.7.1. updateUI()</a> <a href="#ref-for-backgroundfetchupdateuievent-ui-updated-flag①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-backgroundfetchupdateuievent-updateui">
   <b><a href="#dom-backgroundfetchupdateuievent-updateui">#dom-backgroundfetchupdateuievent-updateui</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-backgroundfetchupdateuievent-updateui">6.7. BackgroundFetchUpdateUIEvent</a>
    <li><a href="#ref-for-dom-backgroundfetchupdateuievent-updateui①">6.7.1. updateUI()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="background-fetch-click">
   <b><a href="#background-fetch-click">#background-fetch-click</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-background-fetch-click">7.1. Click</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>